fix: ensure supplementalgroups when using devices are actually added (#942)

This commit is contained in:
Kjeld Schouten-Lebbing 2021-09-09 14:20:26 +02:00 committed by GitHub
parent c861fef094
commit cc1cde7fdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 10 deletions

View File

@ -18,4 +18,4 @@ maintainers:
name: common name: common
sources: null sources: null
type: library type: library
version: 6.13.9 version: 6.13.10

View File

@ -129,25 +129,29 @@
{{- $_ := set .Values.securityContext "privileged" true -}} {{- $_ := set .Values.securityContext "privileged" true -}}
{{- end }} {{- end }}
{{/* save supplementalGroups to placeholder variable */}} {{/* save supplementalGroups to placeholder variables */}}
{{- $supGroups := list }} {{- $fixedGroups := list 568 }}
{{ if .Values.podSecurityContext.supplementalGroups }} {{- $valuegroups := list }}
{{- $supGroups = .Values.podSecurityContext.supplementalGroups }} {{- $devGroups := list }}
{{- $gpuGroups := list }}
{{/* put user-entered supplementalgroups in placeholder variable */}}
{{- if .Values.podSecurityContext.supplementalGroups }}
{{- $valuegroups = .Values.podSecurityContext.supplementalGroups }}
{{- end }} {{- end }}
{{/* Append requered groups to supplementalGroups when deviceList is used */}} {{/* Append requered groups to supplementalGroups when deviceList is used */}}
{{- if .Values.deviceList}} {{- if .Values.deviceList}}
{{- $devGroups := list 5 20 24 }} {{- $devGroups = list 5 20 24 }}
{{- $supGroups := list ( concat $supGroups $devGroups ) }}
{{- end }} {{- end }}
{{/* Append requered groups to supplementalGroups when scaleGPU is used */}} {{/* Append requered groups to supplementalGroups when scaleGPU is used */}}
{{- if .Values.scaleGPU }} {{- if .Values.scaleGPU }}
{{- $gpuGroups := list 44 107 }} {{- $gpuGroups = list 44 107 }}
{{- $supGroups := list ( concat $supGroups $gpuGroups ) }}
{{- end }} {{- end }}
{{/* write appended supplementalGroups to .Values */}} {{/* combine and write all supplementalGroups to .Values */}}
{{- $supGroups := concat $fixedGroups $valuegroups $devGroups $gpuGroups }}
{{- $_ := set .Values.podSecurityContext "supplementalGroups" $supGroups -}} {{- $_ := set .Values.podSecurityContext "supplementalGroups" $supGroups -}}
{{/* merge serviceList with service */}} {{/* merge serviceList with service */}}