Skip to content

Commit

Permalink
Fix check for api resources
Browse files Browse the repository at this point in the history
  • Loading branch information
iabudiab committed Nov 7, 2020
1 parent 6b4612d commit 80bc3d6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Sources/SwiftkubeModelGen/Model/Resource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,7 @@ struct Resource: Decodable, Comparable {
self.requiresCodableExtension = properties.contains { $0.type.requiresCodableExtension }
self.hasMetadata = properties.contains { $0.type.isMetadata }
self.isListResource = properties.contains(where: { $0.name == "items" }) && gvk?.kind.hasSuffix("List") ?? false
self.isAPIResource =
!self.isListResource &&
!SpecialAPITypes.contains(resourceKey ?? "") &&
!NonAPITypes.contains(resourceKey ?? "") &&
properties.contains(where: { $0.name == "apiVersion" && $0.isContant }) &&
properties.contains(where: { $0.name == "kind" && $0.isContant })
self.isAPIResource = APITypes.contains(gvk?.kind ?? "")
}

static func < (lhs: Resource, rhs: Resource) -> Bool {
Expand Down

0 comments on commit 80bc3d6

Please sign in to comment.