Skip to content

Commit

Permalink
[sap-seeds] Move common flavors to templates and add kvm
Browse files Browse the repository at this point in the history
  • Loading branch information
fwiesel committed Jan 23, 2025
1 parent 53ed5ad commit bea5a27
Show file tree
Hide file tree
Showing 2 changed files with 371 additions and 454 deletions.
24 changes: 23 additions & 1 deletion openstack/sap-seeds/templates/flavor-seed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@ spec:
requires:
- monsoon3/nova-flavor-seed
flavors:
{{- range $name, $values := .Values.flavors.untemplated }}
### From .Values.flavors.(templates x hypervisors)
{{- range $hyp, $hypervisor := $.Values.flavors.hypervisors }}
{{- $hypervisorSpec := default (dict) $hypervisor.spec }}
{{- range $ver, $version := $hypervisor.variants }}
{{- $hypervisorVerSpec := merge (default (dict) $hypervisor.spec) $hypervisorSpec }}
{{- range $cat, $category := $.Values.flavors.templates }}
{{- $categorySpec := default (dict) $category.spec }}
{{- range $cpu, $cpus:= $category.variants }}
{{- $cpuSpec := merge (default (dict) $cpus.spec) $categorySpec }}
{{- range $ram, $rams:= $cpus.variants }}
{{- $ramSpec := merge (default (dict) $rams.spec) $cpuSpec }}
{{- $name := list $cat $hyp $cpu $ram $ver | join "_"}}
{{- $overrides := get $.Values.flavors.overrides $name | default (dict) }}
{{- $spec := merge $overrides $hypervisorVerSpec $ramSpec }}
- name: {{ $name }}
{{- toYaml $spec | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
### From .Values.flavors.untemplated
{{- range $name, $values := $.Values.flavors.untemplated }}
- name: {{ $name }}
{{- toYaml $values | nindent 4 }}
{{- end }}
Expand Down
Loading

0 comments on commit bea5a27

Please sign in to comment.