Fix permission issue with 1.10 and defaults when upgraded (#423)

* Fix permission issue with 1.10 and defaults when upgraded

Signed-off-by: Kevin Fox <[email protected]>

* Fix indenting

Signed-off-by: Kevin Fox <[email protected]>

* incorperate feedback

Signed-off-by: Kevin Fox <[email protected]>

* Fix docs

Signed-off-by: Kevin Fox <[email protected]>

---------

Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
kfox1111
2024-08-13 22:21:20 -07:00
committed by GitHub
parent 827a3ea80c
commit 9b2d72f6a2
5 changed files with 62 additions and 2 deletions
@@ -318,3 +318,17 @@ subjects:
namespace: {{ include "spire-server.namespace" . }}
{{- end }}
{{- end }}
{{- define "spire-server.podSecurityContext" -}}
{{- $podSecurityContext := include "spire-lib.podsecuritycontext" . | fromYaml }}
{{- $openshift := ((.Values).global).openshift | default false }}
{{- if not $openshift }}
{{- if not (hasKey $podSecurityContext "runAsUser") }}
{{- $_ := set $podSecurityContext "runAsUser" 1000 }}
{{- end }}
{{- if not (hasKey $podSecurityContext "runAsGroup") }}
{{- $_ := set $podSecurityContext "runAsGroup" 1000 }}
{{- end }}
{{- end }}
{{- toYaml $podSecurityContext }}
{{- end }}