Skip to content

Commit

Permalink
Fix Kapitan plugin securityContext on non-Openshift clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Nov 17, 2023
1 parent 9ee292d commit 70a086c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions component/argocd.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ local repoServer = {
image: common.render_image('kapitan', include_tag=true),
securityContext: {
runAsNonRoot: true,
// use user 999, since the main repo-server container also uses user
// 999 and we need to make sure that the main repo-server container
// has write permissions on the cmp-server socket created by this
// container.
[if !isOpenshift then 'runAsUser']: 999,
},
volumeMounts_: {
'var-files': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ spec:
ports: []
securityContext:
runAsNonRoot: true
runAsUser: 100
stdin: false
tty: false
volumeMounts:
Expand Down
1 change: 1 addition & 0 deletions tests/golden/params/argocd/argocd/30_argocd/10_argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec:
ports: []
securityContext:
runAsNonRoot: true
runAsUser: 100
stdin: false
tty: false
volumeMounts:
Expand Down

0 comments on commit 70a086c

Please sign in to comment.