@@ -50,7 +50,10 @@ func testRBACClusterRoleManagerRules(t *testing.T, rbac rbacv1.ClusterRole) {
5050 "watch" ,
5151 },
5252 APIGroups : []string {"" },
53- Resources : []string {"configmaps" },
53+ Resources : []string {
54+ "configmaps" ,
55+ "secrets" ,
56+ },
5457 },
5558 {
5659 Verbs : []string {
@@ -60,29 +63,6 @@ func testRBACClusterRoleManagerRules(t *testing.T, rbac rbacv1.ClusterRole) {
6063 APIGroups : []string {"" },
6164 Resources : []string {"events" },
6265 },
63- {
64- Verbs : []string {
65- "create" ,
66- "list" ,
67- "update" ,
68- "watch" ,
69- },
70- APIGroups : []string {"" },
71- Resources : []string {"secrets" },
72- },
73- {
74- Verbs : []string {
75- "create" ,
76- "delete" ,
77- "get" ,
78- "list" ,
79- "patch" ,
80- "update" ,
81- "watch" ,
82- },
83- APIGroups : []string {"apps" },
84- Resources : []string {"deployments" },
85- },
8666 {
8767 Verbs : []string {
8868 "create" ,
@@ -94,81 +74,38 @@ func testRBACClusterRoleManagerRules(t *testing.T, rbac rbacv1.ClusterRole) {
9474 "watch" ,
9575 },
9676 APIGroups : []string {"app.terraform.io" },
97- Resources : []string {"agentpools" },
98- } ,
99- {
100- Verbs : [] string {
101- "update " ,
77+ Resources : []string {
78+ "agentpools" ,
79+ "modules" ,
80+ "projects" ,
81+ "workspaces " ,
10282 },
103- APIGroups : []string {"app.terraform.io" },
104- Resources : []string {"agentpools/finalizers" },
10583 },
10684 {
10785 Verbs : []string {
108- "get" ,
109- "patch" ,
11086 "update" ,
11187 },
11288 APIGroups : []string {"app.terraform.io" },
113- Resources : []string {"agentpools/status" },
114- },
115- {
116- Verbs : []string {
117- "create" ,
118- "delete" ,
119- "get" ,
120- "list" ,
121- "patch" ,
122- "update" ,
123- "watch" ,
89+ Resources : []string {
90+ "agentpools/finalizers" ,
91+ "modules/finalizers" ,
92+ "projects/finalizers" ,
93+ "workspaces/finalizers" ,
12494 },
125- APIGroups : []string {"app.terraform.io" },
126- Resources : []string {"modules" },
12795 },
12896 {
12997 Verbs : []string {
130- "update" ,
131- },
132- APIGroups : []string {"app.terraform.io" },
133- Resources : []string {"modules/finalizers" },
134- },
135- {
136- Verbs : []string {
137- "get" ,
138- "patch" ,
139- "update" ,
140- },
141- APIGroups : []string {"app.terraform.io" },
142- Resources : []string {"modules/status" },
143- },
144- {
145- Verbs : []string {
146- "create" ,
147- "delete" ,
14898 "get" ,
149- "list" ,
15099 "patch" ,
151100 "update" ,
152- "watch" ,
153101 },
154102 APIGroups : []string {"app.terraform.io" },
155- Resources : []string {"projects" },
156- },
157- {
158- Verbs : []string {
159- "update" ,
160- },
161- APIGroups : []string {"app.terraform.io" },
162- Resources : []string {"projects/finalizers" },
163- },
164- {
165- Verbs : []string {
166- "get" ,
167- "patch" ,
168- "update" ,
103+ Resources : []string {
104+ "agentpools/status" ,
105+ "modules/status" ,
106+ "projects/status" ,
107+ "workspaces/status" ,
169108 },
170- APIGroups : []string {"app.terraform.io" },
171- Resources : []string {"projects/status" },
172109 },
173110 {
174111 Verbs : []string {
@@ -180,24 +117,8 @@ func testRBACClusterRoleManagerRules(t *testing.T, rbac rbacv1.ClusterRole) {
180117 "update" ,
181118 "watch" ,
182119 },
183- APIGroups : []string {"app.terraform.io" },
184- Resources : []string {"workspaces" },
185- },
186- {
187- Verbs : []string {
188- "update" ,
189- },
190- APIGroups : []string {"app.terraform.io" },
191- Resources : []string {"workspaces/finalizers" },
192- },
193- {
194- Verbs : []string {
195- "get" ,
196- "patch" ,
197- "update" ,
198- },
199- APIGroups : []string {"app.terraform.io" },
200- Resources : []string {"workspaces/status" },
120+ APIGroups : []string {"apps" },
121+ Resources : []string {"deployments" },
201122 },
202123 }
203124 assert .Equal (t , rules , rbac .Rules )
0 commit comments