Skip to content

Commit c65b397

Browse files
pwittrockdroot
authored andcommitted
Update ux to allow either "" or "core" for informer and rbac groups in annotations
1 parent 552cb2d commit c65b397

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

cmd/internal/codegen/parse/rbac.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ func parseRBACTag(tag string) rbacv1.PolicyRule {
6464
values = strings.Split(value, ";")
6565
switch kv[0] {
6666
case "groups":
67+
normalized := []string{}
68+
for _, v := range values {
69+
if v == "core" {
70+
normalized = append(normalized, "")
71+
} else {
72+
normalized = append(normalized, v)
73+
}
74+
}
6775
result.APIGroups = values
6876
case "resources":
6977
result.Resources = values
@@ -112,6 +120,9 @@ func parseInformerTag(tag string) v1.GroupVersionKind {
112120
value := kv[1]
113121
switch kv[0] {
114122
case "group":
123+
if value == "" {
124+
value = "core"
125+
}
115126
result.Group = value
116127
case "version":
117128
result.Version = value

0 commit comments

Comments
 (0)