Skip to content

Commit 8dd0ed2

Browse files
committed
fix(manifests): skip CRDs with kind suffix 'List' during component generation
Signed-off-by: Malka Ali [email protected]
1 parent 03be64a commit 8dd0ed2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

utils/manifests/generateComponent.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package manifests
22

33
import (
44
"context"
5+
"strings"
56

67
"cuelang.org/go/cue"
78
"cuelang.org/go/cue/cuecontext"
@@ -36,6 +37,17 @@ func GenerateComponents(ctx context.Context, manifest string, resource int, cfg
3637
}
3738
parsedCrd = cueCtx.BuildExpr(expr)
3839
}
40+
kindVal := parsedCrd.LookupPath(cue.ParsePath("spec.names.kind"))
41+
if kindVal.Exists() {
42+
kindStr, err := kindVal.String()
43+
if err != nil {
44+
continue // skip if unable to convert to string
45+
}
46+
if strings.HasSuffix(kindStr, "List") {
47+
continue // skip List kinds
48+
}
49+
}
50+
3951
outDef, err := getDefinitions(parsedCrd, resource, cfg, ctx)
4052
if err != nil {
4153
// inability to generate component for a single crd should not affect the rest

0 commit comments

Comments
 (0)