Cinder: update functions to live in correct locations

This PS simply moves functions within the chart to their correct location.

Change-Id: I6430304528b964d9babcd54e3336f3016b8efde6
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2018-06-13 17:43:47 -05:00
parent f0937065ed
commit 641cc4a15a
6 changed files with 44 additions and 29 deletions

View File

@ -67,7 +67,7 @@ spec:
subPath: key
readOnly: true
{{ end }}
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: ceph-keyring-placement
{{ tuple $envAll "cinder_backup" | include "helm-toolkit.snippets.image" | indent 10 }}
securityContext:
@ -76,7 +76,7 @@ spec:
- /tmp/ceph-keyring.sh
env:
- name: RBD_USER
value: {{ index (index .Values.conf.backends (include "cinder.ceph_volume_section_name" $envAll)) "rbd_user" | quote }}
value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "rbd_user" | quote }}
volumeMounts:
- name: etcceph
mountPath: /etc/ceph
@ -137,7 +137,7 @@ spec:
mountPath: /etc/cinder/cinder.conf
subPath: cinder.conf
readOnly: true
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.is_ceph_volume_configured" $envAll) }}
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.utils.is_ceph_volume_configured" $envAll) }}
- name: etcceph
mountPath: /etc/ceph
- name: ceph-etc
@ -186,7 +186,7 @@ spec:
configMap:
name: cinder-bin
defaultMode: 0555
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.is_ceph_volume_configured" $envAll) }}
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.utils.is_ceph_volume_configured" $envAll) }}
- name: etcceph
emptyDir: {}
- name: ceph-etc
@ -199,7 +199,7 @@ spec:
secret:
secretName: {{ .Values.secrets.rbd.backup | quote }}
{{ end }}
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: ceph-keyring
secret:
secretName: {{ .Values.secrets.rbd.volume | quote }}

View File

@ -45,7 +45,7 @@ spec:
{{ .Values.labels.volume.node_selector_key }}: {{ .Values.labels.volume.node_selector_value }}
initContainers:
{{ tuple $envAll "volume" $mounts_cinder_volume_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: ceph-keyring-placement
{{ tuple $envAll "cinder_volume" | include "helm-toolkit.snippets.image" | indent 10 }}
securityContext:
@ -54,7 +54,7 @@ spec:
- /tmp/ceph-keyring.sh
env:
- name: RBD_USER
value: {{ index (index .Values.conf.backends (include "cinder.ceph_volume_section_name" $envAll)) "rbd_user" | quote }}
value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "rbd_user" | quote }}
volumeMounts:
- name: etcceph
mountPath: /etc/ceph
@ -102,7 +102,7 @@ spec:
mountPath: /etc/cinder/conf/backends.conf
subPath: backends.conf
readOnly: true
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: etcceph
mountPath: /etc/ceph
- name: ceph-etc
@ -152,7 +152,7 @@ spec:
- name: cinder-etc
configMap:
name: cinder-etc
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: etcceph
emptyDir: {}
- name: ceph-etc

View File

@ -16,7 +16,7 @@ limitations under the License.
{{- if .Values.manifests.job_clean }}
{{- $envAll := . }}
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.is_ceph_volume_configured" $envAll) }}
{{ if or (eq .Values.conf.cinder.DEFAULT.backup_driver "cinder.backup.drivers.ceph") (include "cinder.utils.is_ceph_volume_configured" $envAll) }}
{{- $randStringSuffix := randAlphaNum 5 | lower }}
@ -69,7 +69,7 @@ spec:
initContainers:
{{ tuple $envAll "clean" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: cinder-volume-rbd-secret-clean
{{ tuple $envAll "cinder_storage_init" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.clean | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}

View File

@ -64,7 +64,7 @@ spec:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
initContainers:
{{ tuple $envAll "storage_init" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: ceph-keyring-placement
{{ tuple $envAll "cinder_storage_init" | include "helm-toolkit.snippets.image" | indent 10 }}
securityContext:
@ -94,13 +94,13 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: STORAGE_BACKEND
value: {{ index (index .Values.conf.backends (include "cinder.ceph_volume_section_name" $envAll)) "volume_driver" | quote }}
value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "volume_driver" | quote }}
- name: RBD_POOL_NAME
value: {{ index (index .Values.conf.backends (include "cinder.ceph_volume_section_name" $envAll)) "rbd_pool" | quote }}
value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "rbd_pool" | quote }}
- name: RBD_POOL_USER
value: {{ index (index .Values.conf.backends (include "cinder.ceph_volume_section_name" $envAll)) "rbd_user" | quote }}
value: {{ index (index .Values.conf.backends (include "cinder.utils.ceph_volume_section_name" $envAll)) "rbd_user" | quote }}
- name: RBD_POOL_CRUSH_RULE
value: {{ .Values.conf.ceph.pools.volume.crush_rule | quote }}
- name: RBD_POOL_REPLICATION
@ -117,7 +117,7 @@ spec:
mountPath: /tmp/storage-init.sh
subPath: storage-init.sh
readOnly: true
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: etcceph
mountPath: /etc/ceph
- name: ceph-etc
@ -136,7 +136,7 @@ spec:
configMap:
name: cinder-bin
defaultMode: 0555
{{- if include "cinder.is_ceph_volume_configured" $envAll }}
{{- if include "cinder.utils.is_ceph_volume_configured" $envAll }}
- name: etcceph
emptyDir: {}
- name: ceph-etc

View File

@ -14,17 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "cinder.is_ceph_volume_configured" -}}
{{- range $section, $values := .Values.conf.backends -}}
{{- if kindIs "map" $values -}}
{{- if eq $values.volume_driver "cinder.volume.drivers.rbd.RBDDriver" -}}
true
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "cinder.ceph_volume_section_name" -}}
{{- define "cinder.utils.ceph_volume_section_name" -}}
{{- range $section, $values := .Values.conf.backends -}}
{{- if kindIs "map" $values -}}
{{- if eq $values.volume_driver "cinder.volume.drivers.rbd.RBDDriver" -}}

View File

@ -0,0 +1,25 @@
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "cinder.utils.is_ceph_volume_configured" -}}
{{- range $section, $values := .Values.conf.backends -}}
{{- if kindIs "map" $values -}}
{{- if eq $values.volume_driver "cinder.volume.drivers.rbd.RBDDriver" -}}
true
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}