Enable serviceAccountAllowList to autocalculate namespace (#304)
* Enable serviceAccountAllowList to autocalculate namespace Signed-off-by: Kevin Fox <[email protected]> * Incorperate feedback Signed-off-by: Kevin Fox <[email protected]> * Update charts/spire/charts/spire-server/values.yaml Co-authored-by: Faisal Memon <[email protected]> Signed-off-by: kfox1111 <[email protected]> * Fix docs Signed-off-by: Kevin Fox <[email protected]> --------- Signed-off-by: Kevin Fox <[email protected]> Signed-off-by: kfox1111 <[email protected]> Co-authored-by: Faisal Memon <[email protected]>
This commit is contained in:
@@ -145,10 +145,19 @@ Create the name of the service account to use
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.serviceAccountAllowedList" }}
|
||||
{{- $releaseNamespace := include "spire-server.agent-namespace" . }}
|
||||
{{- if ne (len .Values.nodeAttestor.k8sPsat.serviceAccountAllowList) 0 }}
|
||||
{{- .Values.nodeAttestor.k8sPsat.serviceAccountAllowList | toJson }}
|
||||
{{- $list := list }}
|
||||
{{- range .Values.nodeAttestor.k8sPsat.serviceAccountAllowList }}
|
||||
{{- if contains ":" . }}
|
||||
{{- $list = append $list . }}
|
||||
{{- else }}
|
||||
{{- $list = append $list ( printf "%s:%s" $releaseNamespace . ) | }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $list | toJson }}
|
||||
{{- else }}
|
||||
[{{ printf "%s:%s-agent" (include "spire-server.agent-namespace" .) .Release.Name | quote }}]
|
||||
[{{ printf "%s:%s-agent" $releaseNamespace .Release.Name | quote }}]
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user