Merge "Add extra spec or property for nova bootstrap script"

This commit is contained in:
Zuul
2025-09-02 21:43:09 +00:00
committed by Gerrit Code Review
2 changed files with 30 additions and 13 deletions

View File

@@ -18,20 +18,30 @@ set -ex
export HOME=/tmp
{{ if .Values.bootstrap.structured.flavors.enabled }}
{{ range .Values.bootstrap.structured.flavors.options }}
# NOTE(aostapenko) Since Wallaby with switch of osc to sdk '--id auto' is no
# longer treated specially. Though the same behavior can be achieved w/o specifying
#--id flag.
# https://review.opendev.org/c/openstack/python-openstackclient/+/750151
{{- range $i, $params := .Values.bootstrap.structured.flavors.options }}
{
openstack flavor show {{ .name }} || \
openstack flavor create {{ .name }} \
{{ if .id }} \
--id {{ .id }} \
{{ end }} \
--ram {{ .ram }} \
--disk {{ .disk }} \
--vcpus {{ .vcpus }}
openstack flavor show {{ $params.name }} || \
openstack flavor create \
{{- range $key, $val := $params }}
{{- if ne $key "name" }}
{{- if eq $key "extra_specs" }}
{{- if kindIs "slice" $val }}
{{- range $idx, $spec := $val }}
--property {{ $spec }} \
{{- end }}
{{- end }}
{{- else if eq $key "is_public" }}
{{- if $val }}
--public \
{{- else if not $val }}
--private \
{{- end }}
{{- else }}
--{{ $key }} {{ $val }} \
{{- end }}
{{- end }}
{{- end }}
{{ $params.name }}
} &
{{ end }}
wait

View File

@@ -0,0 +1,7 @@
---
nova:
- |
Refactored the flavor creation logic in the nova bootstrap script to simplify
and generalize flavor definitions using dynamic key/value iteration. This makes
the chart more maintainable and flexible for various flavor configurations.
...