libvirt: fix operation when ceph is disabled

The movement of the ceph secret logic into the start script introduced
a bug that was missed in review when ceph is disabled, this PS
restores expected operation.

Closes-Bug: #1720061

Change-Id: Ie373ff94814ea396832a83101c885ebf92b6f8cc
This commit is contained in:
Pete Birley 2017-09-28 09:56:23 -05:00 committed by Chris Wedgwood
parent a2cc27ea6a
commit af1e19ef49
2 changed files with 51 additions and 40 deletions

View File

@ -30,6 +30,7 @@ if [[ -c /dev/kvm ]]; then
chown root:kvm /dev/kvm
fi
if [ "x${LIBVIRT_CEPH_ENABLED}" == "xTrue" ] ; then
libvirtd --listen &
LIBVIRT_SECRET_DEF=$(mktemp --suffix .xml)
@ -86,3 +87,6 @@ virsh secret-set-value --secret "${LIBVIRT_CEPH_SECRET_UUID}" --base64 "${CEPH_C
# rejoin libvirtd
wait
else
exec libvirtd --listen
fi

View File

@ -46,6 +46,9 @@ spec:
securityContext:
runAsUser: 0
env:
{{- if .Values.ceph.enabled }}
- name: LIBVIRT_CEPH_ENABLED
value: "True"
- name: CEPH_CINDER_USER
value: "{{ .Values.ceph.cinder_user }}"
{{- if .Values.ceph.cinder_keyring }}
@ -54,6 +57,10 @@ spec:
{{ end }}
- name: LIBVIRT_CEPH_SECRET_UUID
value: "{{ .Values.ceph.secret_uuid }}"
{{- else }}
- name: LIBVIRT_CEPH_ENABLED
value: "False"
{{- end }}
command:
- /tmp/ceph-keyring.sh
volumeMounts: