@@ -39,8 +39,9 @@ func (b *APIs) parseRBAC() {
39
39
func (b * APIs ) getRBACTag (c * types.Type ) []string {
40
40
comments := Comments (c .CommentLines )
41
41
resource := comments .getTags ("rbac" , ":" )
42
+ resource = append (resource , comments .getTags ("kubebuilder:rbac" , ":" )... )
42
43
if len (resource ) == 0 {
43
- panic (fmt .Errorf ("Must specify +rbac comment for type %v" , c .Name ))
44
+ panic (fmt .Errorf ("Must specify +kubebuilder: rbac comment for type %v" , c .Name ))
44
45
}
45
46
return resource
46
47
}
@@ -50,7 +51,7 @@ func parseRBACTag(tag string) rbacv1.PolicyRule {
50
51
for _ , elem := range strings .Split (tag , "," ) {
51
52
kv := strings .Split (elem , "=" )
52
53
if len (kv ) != 2 {
53
- log .Fatalf ("// +rbac: tags must be key value pairs. Expected " +
54
+ log .Fatalf ("// +kubebuilder: rbac: tags must be key value pairs. Expected " +
54
55
"keys [groups=<group1;group2>,resources=<resource1;resource2>,verbs=<verb1;verb2>] " +
55
56
"Got string: [%s]" , tag )
56
57
}
@@ -90,8 +91,9 @@ func (b *APIs) parseInformers() {
90
91
func (b * APIs ) getInformerTag (c * types.Type ) []string {
91
92
comments := Comments (c .CommentLines )
92
93
resource := comments .getTags ("informers" , ":" )
94
+ resource = append (resource , comments .getTags ("kubebuilder:informers" , ":" )... )
93
95
if len (resource ) == 0 {
94
- panic (fmt .Errorf ("Must specify +informers comment for type %v" , c .Name ))
96
+ panic (fmt .Errorf ("Must specify +kubebuilder: informers comment for type %v" , c .Name ))
95
97
}
96
98
return resource
97
99
}
@@ -101,7 +103,7 @@ func parseInformerTag(tag string) v1.GroupVersionKind {
101
103
for _ , elem := range strings .Split (tag , "," ) {
102
104
kv := strings .Split (elem , "=" )
103
105
if len (kv ) != 2 {
104
- log .Fatalf ("// +informers: tags must be key value pairs. Expected " +
106
+ log .Fatalf ("// +kubebuilder: informers: tags must be key value pairs. Expected " +
105
107
"keys [group=core,version=v1,kind=Pod] " +
106
108
"Got string: [%s]" , tag )
107
109
}
0 commit comments