Skip to content

Commit

Permalink
fix: properly determine list objects in schemagen
Browse files Browse the repository at this point in the history
  • Loading branch information
rquitales committed Sep 14, 2024
1 parent 7155e2e commit 08cb054
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,16 @@ func PulumiSchema(swagger map[string]any, opts ...schemaGeneratorOption) pschema
for _, kind := range version.Kinds() {
tok := fmt.Sprintf(`kubernetes:%s:%s`, kind.apiVersion, kind.kind)
var patchTok string
if !strings.HasSuffix(kind.kind, "List") {

containsItems := false
for _, prop := range kind.Properties() {
if prop.name == "items" {
containsItems = true
break
}
}

if !(strings.HasSuffix(kind.kind, "List") && containsItems) {
patchTok = fmt.Sprintf("%sPatch", tok)
}

Expand Down

0 comments on commit 08cb054

Please sign in to comment.