From 8ea0e2789238cdbb513785b711848771f4748769 Mon Sep 17 00:00:00 2001 From: Sophie Huang Date: Mon, 23 Aug 2021 20:48:11 +0000 Subject: [PATCH] Add logic to Cinder bootstrap to handle timing issue During upgrade, the Cinder pods go through the upgrade process. Sometimes, the pods are unavailable to handle the requests in bootstrap even the Cinder services are up. This patchset gives the bootstrap job additional attempt to finish the tasks Change-Id: Ie7bd8909f1c93b76b2242748318f892a6ff9c53d --- cinder/Chart.yaml | 2 +- cinder/templates/bin/_bootstrap.sh.tpl | 11 ++++++++++- releasenotes/notes/cinder.yaml | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cinder/Chart.yaml b/cinder/Chart.yaml index 208f5f6f09..7d463ead61 100644 --- a/cinder/Chart.yaml +++ b/cinder/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Cinder name: cinder -version: 0.2.7 +version: 0.2.8 home: https://docs.openstack.org/cinder/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png sources: diff --git a/cinder/templates/bin/_bootstrap.sh.tpl b/cinder/templates/bin/_bootstrap.sh.tpl index ea6bbd585a..be74cfc126 100644 --- a/cinder/templates/bin/_bootstrap.sh.tpl +++ b/cinder/templates/bin/_bootstrap.sh.tpl @@ -27,13 +27,22 @@ export HOME=/tmp {{- range $name, $properties := $volumeTypes }} {{- if $properties.volume_backend_name }} {{- if (eq $properties.volume_backend_name $backend_properties.volume_backend_name) }} -openstack volume type show {{ $name }} || \ +if [[ $(openstack volume type list -f value -c Name | grep -w {{ $name }}) ]]; then + if [[ ! $(openstack volume type show {{ $name }} | grep volume_backend_name) ]]; then + openstack volume type set \ + {{- range $key, $value := $properties }} + --property {{ $key }}={{ $value }} \ + {{- end }} + {{ $name }} + fi +else openstack volume type create \ --public \ {{- range $key, $value := $properties }} --property {{ $key }}={{ $value }} \ {{- end }} {{ $name }} +fi {{- end }} {{- end }} {{- end }} diff --git a/releasenotes/notes/cinder.yaml b/releasenotes/notes/cinder.yaml index dd5c2e900e..569643f967 100644 --- a/releasenotes/notes/cinder.yaml +++ b/releasenotes/notes/cinder.yaml @@ -24,4 +24,5 @@ cinder: - 0.2.5 Add volume QoS support - 0.2.6 Added helm.sh/hook with value of post-install and post-upgrade - 0.2.7 Add Victoria and Wallaby releases support + - 0.2.8 Add logic to bootstrap to handle upgrade timing issue ...