Commit 3499f12
Remove unnecessary RBAC verbs
Applied principle of least privilege across all RBAC markers in
openstacklightspeed_controller.go. Verbs were removed where code
analysis confirmed they are never exercised by the controller.
ClusterRole changes:
- openstacklightspeeds: removed create, delete, update; get, list,
watch, patch are sufficient for normal reconciliation
- openstacklightspeeds/status: removed get, update; only patch is
needed to update the status subresource
- clusterroles: removed list, update, delete; CreateOrPatch uses
get/create/patch, bulk removal uses deletecollection (DeleteAllOf)
- clusterrolebindings: same reasoning as clusterroles
- clusterversions: removed list, watch; only a single Get is
performed to detect the OCP version
- consoleplugins: removed list, update; get/create/patch/delete/watch
cover all actual operations
Role (namespaced) changes:
- clusterserviceversions: removed patch; only update and delete are
needed for owner reference and uninstall
- networkpolicies: removed list, update; CreateOrPatch uses
get/create/patch; owned resources are GC'd by Kubernetes
- deployments: removed list, update, delete; CreateOrPatch uses
get/create/patch; owned resources are GC'd by Kubernetes
- configmaps: removed list, update; get/create/patch/delete cover all
actual operations (one ConfigMap is explicitly deleted on toggle)
- secrets: removed list, update, delete; bulk removal uses
deletecollection (DeleteAllOf); owned secrets are GC'd
- services: removed list, update, delete; CreateOrPatch uses
get/create/patch; owned resources are GC'd by Kubernetes
- consoles: removed list, watch; only Get and Update are called
- persistentvolumeclaims: removed list, update; get/create/patch/watch
cover all actual operations; PVCs are intentionally never deleted
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e770335 commit 3499f12
3 files changed
Lines changed: 17 additions & 71 deletions
File tree
- bundle/manifests
- config/rbac
- internal/controller
Lines changed: 2 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | 179 | | |
182 | 180 | | |
183 | 181 | | |
| |||
186 | 184 | | |
187 | 185 | | |
188 | 186 | | |
189 | | - | |
190 | 187 | | |
191 | | - | |
192 | 188 | | |
193 | 189 | | |
194 | 190 | | |
195 | 191 | | |
196 | 192 | | |
197 | 193 | | |
198 | | - | |
199 | | - | |
200 | 194 | | |
201 | 195 | | |
202 | 196 | | |
203 | | - | |
204 | 197 | | |
205 | 198 | | |
206 | 199 | | |
| |||
213 | 206 | | |
214 | 207 | | |
215 | 208 | | |
216 | | - | |
217 | 209 | | |
218 | | - | |
219 | 210 | | |
220 | 211 | | |
221 | 212 | | |
222 | 213 | | |
223 | 214 | | |
224 | 215 | | |
225 | | - | |
226 | 216 | | |
227 | | - | |
228 | 217 | | |
229 | 218 | | |
230 | 219 | | |
| |||
240 | 229 | | |
241 | 230 | | |
242 | 231 | | |
243 | | - | |
244 | 232 | | |
245 | 233 | | |
246 | | - | |
247 | 234 | | |
248 | | - | |
249 | 235 | | |
250 | 236 | | |
251 | 237 | | |
| |||
380 | 366 | | |
381 | 367 | | |
382 | 368 | | |
383 | | - | |
384 | 369 | | |
385 | 370 | | |
386 | 371 | | |
387 | 372 | | |
388 | | - | |
389 | 373 | | |
390 | | - | |
391 | 374 | | |
392 | 375 | | |
393 | 376 | | |
394 | 377 | | |
395 | 378 | | |
| 379 | + | |
396 | 380 | | |
397 | 381 | | |
398 | 382 | | |
399 | | - | |
400 | 383 | | |
401 | | - | |
402 | 384 | | |
403 | 385 | | |
404 | 386 | | |
405 | 387 | | |
406 | 388 | | |
407 | 389 | | |
408 | 390 | | |
409 | | - | |
410 | 391 | | |
411 | 392 | | |
412 | | - | |
413 | 393 | | |
414 | | - | |
415 | 394 | | |
416 | 395 | | |
417 | 396 | | |
| |||
429 | 408 | | |
430 | 409 | | |
431 | 410 | | |
432 | | - | |
433 | 411 | | |
434 | | - | |
435 | 412 | | |
436 | | - | |
437 | 413 | | |
438 | 414 | | |
439 | 415 | | |
| |||
442 | 418 | | |
443 | 419 | | |
444 | 420 | | |
445 | | - | |
446 | 421 | | |
447 | | - | |
448 | 422 | | |
449 | 423 | | |
450 | 424 | | |
451 | 425 | | |
452 | 426 | | |
453 | 427 | | |
454 | 428 | | |
455 | | - | |
456 | 429 | | |
457 | 430 | | |
458 | 431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
| |||
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
32 | 29 | | |
33 | | - | |
34 | 30 | | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | | - | |
41 | | - | |
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
45 | | - | |
46 | 39 | | |
47 | 40 | | |
48 | 41 | | |
| |||
55 | 48 | | |
56 | 49 | | |
57 | 50 | | |
58 | | - | |
59 | 51 | | |
60 | | - | |
61 | 52 | | |
62 | 53 | | |
63 | 54 | | |
64 | 55 | | |
65 | 56 | | |
66 | 57 | | |
67 | | - | |
68 | 58 | | |
69 | | - | |
70 | 59 | | |
71 | 60 | | |
72 | 61 | | |
| |||
82 | 71 | | |
83 | 72 | | |
84 | 73 | | |
85 | | - | |
86 | 74 | | |
87 | 75 | | |
88 | | - | |
89 | 76 | | |
90 | | - | |
91 | 77 | | |
92 | 78 | | |
93 | 79 | | |
| |||
100 | 86 | | |
101 | 87 | | |
102 | 88 | | |
103 | | - | |
104 | 89 | | |
105 | 90 | | |
106 | 91 | | |
107 | 92 | | |
108 | | - | |
109 | 93 | | |
110 | | - | |
111 | 94 | | |
112 | 95 | | |
113 | 96 | | |
114 | 97 | | |
115 | 98 | | |
| 99 | + | |
116 | 100 | | |
117 | 101 | | |
118 | 102 | | |
119 | | - | |
120 | 103 | | |
121 | | - | |
122 | 104 | | |
123 | 105 | | |
124 | 106 | | |
125 | 107 | | |
126 | 108 | | |
127 | 109 | | |
128 | 110 | | |
129 | | - | |
130 | 111 | | |
131 | 112 | | |
132 | | - | |
133 | 113 | | |
134 | | - | |
135 | 114 | | |
136 | 115 | | |
137 | 116 | | |
| |||
149 | 128 | | |
150 | 129 | | |
151 | 130 | | |
152 | | - | |
153 | 131 | | |
154 | | - | |
155 | 132 | | |
156 | | - | |
157 | 133 | | |
158 | 134 | | |
159 | 135 | | |
| |||
162 | 138 | | |
163 | 139 | | |
164 | 140 | | |
165 | | - | |
166 | 141 | | |
167 | | - | |
168 | 142 | | |
169 | 143 | | |
170 | 144 | | |
171 | 145 | | |
172 | 146 | | |
173 | 147 | | |
174 | 148 | | |
175 | | - | |
176 | 149 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
0 commit comments