Skip to content

Commit 7058b6b

Browse files
JustinKuliopenshift-merge-robot
authored andcommitted
Conditionally set seccompProfile on config-policy
The permissions that the config-policy-controller has changes how this field is automatically determined on some OpenShift clusters. Without this, sometimes the pod can not be created, with a message saying this must be set. Refs: - https://issues.redhat.com/browse/ACM-4590 - https://issues.redhat.com/browse/ACM-5352 Signed-off-by: Justin Kulikauskas <[email protected]>
1 parent 1ec8a5f commit 7058b6b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/addon/configpolicy/manifests/managedclusterchart/templates/cleanup_pod.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,9 @@ spec:
6464
serviceAccount: {{ include "controller.serviceAccountName" . }}
6565
securityContext:
6666
runAsNonRoot: true
67+
{{- if semverCompare ">= 1.25.0" .Capabilities.KubeVersion.Version }}
68+
{{- /* newer OpenShift (4.12+) versions might require this to be explicitly set */}}
69+
{{- /* but not all older kubernetes versions can handle when it is set */}}
70+
seccompProfile:
71+
type: RuntimeDefault
72+
{{- end }}

pkg/addon/configpolicy/manifests/managedclusterchart/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ spec:
184184
serviceAccount: {{ include "controller.serviceAccountName" . }}
185185
securityContext:
186186
runAsNonRoot: true
187+
{{- if semverCompare ">= 1.25.0" .Capabilities.KubeVersion.Version }}
188+
{{- /* newer OpenShift (4.12+) versions might require this to be explicitly set */}}
189+
{{- /* but not all older kubernetes versions can handle when it is set */}}
187190
seccompProfile:
188191
type: RuntimeDefault
192+
{{- end }}
189193
terminationGracePeriodSeconds: 120

0 commit comments

Comments
 (0)