Merge "[Cinder] Gotpl script fix"

This commit is contained in:
Zuul 2020-02-13 20:41:01 +00:00 committed by Gerrit Code Review
commit 040e6aa23a
2 changed files with 3 additions and 8 deletions

View File

@ -90,7 +90,7 @@ spec:
{{ end }}
containers:
{{- range $name, $backend := .Values.conf.backends }}
{{- if kindIs "map" $backend }}
{{- if (eq "true" ( dict "backend" $backend | include "cinder.utils.is_ceph_backend" )) }}
- name: cinder-storage-init-{{$name}}
{{ tuple $envAll "cinder_storage_init" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.storage_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
@ -99,7 +99,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if include "cinder.utils.is_ceph_backend" $backend }}
- name: STORAGE_BACKEND
value: {{ $backend.volume_driver | quote }}
- name: RBD_POOL_NAME
@ -116,7 +115,6 @@ spec:
value: {{ (index $envAll.Values.conf.ceph.pools $backend.rbd_pool).chunk_size | quote }}
- name: RBD_POOL_SECRET
value: {{ $envAll.Values.secrets.rbd.volume | quote }}
{{- end }}
command:
- /tmp/storage-init.sh
volumeMounts:
@ -126,7 +124,6 @@ spec:
mountPath: /tmp/storage-init.sh
subPath: storage-init.sh
readOnly: true
{{- if include "cinder.utils.is_ceph_backend" $backend }}
- name: etcceph
mountPath: /etc/ceph
- name: ceph-etc
@ -139,7 +136,6 @@ spec:
subPath: key
readOnly: true
{{- end }}
{{- end }}
{{- end }}
{{- end }}
volumes:

View File

@ -15,7 +15,6 @@ limitations under the License.
*/}}
{{- define "cinder.utils.is_ceph_backend" -}}
{{- if kindIs "map" . -}}
{{- eq .volume_driver "cinder.volume.drivers.rbd.RBDDriver" -}}
{{- end -}}
{{- $backend := index . "backend" -}}
{{- printf "%v" (and ( kindIs "map" $backend ) ( eq $backend.volume_driver "cinder.volume.drivers.rbd.RBDDriver" )) -}}
{{- end -}}