Skip to content

Commit

Permalink
Update ux to allow either "" or "core" for informer and rbac groups i…
Browse files Browse the repository at this point in the history
…n annotations
  • Loading branch information
pwittrock authored and droot committed May 18, 2018
1 parent 552cb2d commit c65b397
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/internal/codegen/parse/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ func parseRBACTag(tag string) rbacv1.PolicyRule {
values = strings.Split(value, ";")
switch kv[0] {
case "groups":
normalized := []string{}
for _, v := range values {
if v == "core" {
normalized = append(normalized, "")
} else {
normalized = append(normalized, v)
}
}
result.APIGroups = values
case "resources":
result.Resources = values
Expand Down Expand Up @@ -112,6 +120,9 @@ func parseInformerTag(tag string) v1.GroupVersionKind {
value := kv[1]
switch kv[0] {
case "group":
if value == "" {
value = "core"
}
result.Group = value
case "version":
result.Version = value
Expand Down

0 comments on commit c65b397

Please sign in to comment.