Skip to content

Commit a5e8559

Browse files
authored
fix(response actions): Add necessary permissions for jobs and replicasets (#2334)
Signed-off-by: Roberto Scolaro <[email protected]>
1 parent ee36036 commit a5e8559

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

charts/shield/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ maintainers:
1313
- name: mavimo
1414
1515
type: application
16-
version: 1.15.0
16+
version: 1.15.1
1717
appVersion: "1.0.0"

charts/shield/templates/cluster/clusterrole.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ rules:
253253
{{- end }}
254254

255255
{{- if eq "true" (include "cluster.response_actions.isolate_network.enabled" .) }}
256+
- apiGroups:
257+
- batch
258+
resources:
259+
- jobs
260+
verbs:
261+
- get # needed to identify the pods to isolate
262+
256263
- apiGroups:
257264
- apps
258265
resources:
@@ -281,12 +288,20 @@ rules:
281288
{{- end }}
282289

283290
{{- if eq "true" (include "cluster.response_actions.get_logs.enabled" .) }}
291+
- apiGroups:
292+
- batch
293+
resources:
294+
- jobs
295+
verbs:
296+
- get # needed to identify the pods to get logs from
297+
284298
- apiGroups:
285299
- apps
286300
resources:
287301
- daemonsets
288302
- deployments
289303
- statefulsets
304+
- replicasets
290305
verbs:
291306
- get # needed to identify the pods to get logs from
292307

@@ -306,12 +321,20 @@ rules:
306321
{{- end }}
307322

308323
{{- if eq "true" (include "cluster.response_actions.volume_snapshot.enabled" .) }}
324+
- apiGroups:
325+
- batch
326+
resources:
327+
- jobs
328+
verbs:
329+
- get # needed to identify the pods with PVCs
330+
309331
- apiGroups:
310332
- apps
311333
resources:
312334
- daemonsets
313335
- deployments
314336
- statefulsets
337+
- replicasets
315338
verbs:
316339
- get # needed to identify the pods with PVCs
317340

charts/shield/tests/cluster/clusterrole_test.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,15 @@ tests:
504504
of: ClusterRole
505505
- isAPIVersion:
506506
of: rbac.authorization.k8s.io/v1
507+
- contains:
508+
path: rules
509+
content:
510+
apiGroups:
511+
- batch
512+
resources:
513+
- jobs
514+
verbs:
515+
- get
507516
- contains:
508517
path: rules
509518
content:
@@ -536,6 +545,7 @@ tests:
536545
- daemonsets
537546
- deployments
538547
- statefulsets
548+
- replicasets
539549
verbs:
540550
- get
541551
- contains:
@@ -566,6 +576,7 @@ tests:
566576
- daemonsets
567577
- deployments
568578
- statefulsets
579+
- replicasets
569580
verbs:
570581
- get
571582
- contains:
@@ -595,6 +606,7 @@ tests:
595606
- daemonsets
596607
- deployments
597608
- statefulsets
609+
- replicasets
598610
verbs:
599611
- get
600612
- contains:

0 commit comments

Comments
 (0)