fix: fix volume type create to honor encrypt type

There is no way to create encrypted volume type in current bootstrap script.
This patch makes sure we allow create encrypted volume types.

Change-Id: Ie486509fb0028e21270c18a2d27b56405eac1e29
This commit is contained in:
ricolin 2024-08-21 12:09:33 +08:00
parent b335209154
commit ec305f8dc3
3 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Cinder
name: cinder
version: 0.3.23
version: 0.3.24
home: https://docs.openstack.org/cinder/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Cinder/OpenStack_Project_Cinder_vertical.png
sources:

View File

@ -38,6 +38,11 @@ export HOME=/tmp
openstack volume type show {{ $name }} || \
openstack volume type create \
--{{ $access_type }} \
{{- range $key, $value := $properties }}
{{- if or (eq $key "encryption-provider") (eq $key "encryption-cipher") (eq $key "encryption-key-size") (eq $key "encryption-control-location") }}
--{{ $key }} {{ $value}} \
{{- end }}
{{- end }}
{{ $name }}
{{/*
We will try to set or update volume type properties.
@ -64,7 +69,7 @@ export HOME=/tmp
{{- end }}
{{- range $key, $value := $properties }}
{{- if and (ne $key "access_type") (ne $key "grant_access") $value }}
{{- if and (ne $key "access_type") (ne $key "grant_access") (ne $key "encryption-provider") (ne $key "encryption-cipher") (ne $key "encryption-key-size") (ne $key "encryption-control-location") $value }}
openstack volume type set --property {{ $key }}={{ $value }} {{ $name }}
{{- end }}
{{- end }}

View File

@ -73,4 +73,5 @@ cinder:
- 0.3.21 Enable custom annotations for Openstack secrets
- 0.3.22 Update images used by default
- 0.3.23 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default
- 0.3.24 Fix volume type create to allow encrypt volume type
...