Skip to content

Commit

Permalink
Fix Volume AZ Generation
Browse files Browse the repository at this point in the history
Seemingly the "default" function always expects some sane default, and
does very odd things if you give it an undefined default.  Instead
switch to using regular conditional logic so we can guarantee the
nil/nil output from the macro is nil, and we can condititionally
generate the AZ code.  Said AZ code has also been altered to adhere to
the the new breaking CR format change.
  • Loading branch information
spjmurray committed Sep 30, 2024
1 parent 182e751 commit 5464680
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-api-cluster-openstack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: cluster-api-cluster-openstack
description: A Helm chart to deploy a Kubernetes Cluster
type: application
version: v0.5.5
version: v0.5.6
icon: https://raw.githubusercontent.com/unikorn-cloud/helm-cluster-api/main/icons/default.png
2 changes: 1 addition & 1 deletion charts/cluster-api-cluster-openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
source:
repoURL: https://unikorn-cloud.github.io/helm-cluster-api
chart: cluster-api-cluster-openstack
targetRevision: v0.5.5
targetRevision: v0.5.6
helm:
releaseName: foo
# Remove the default work queue.
Expand Down
6 changes: 5 additions & 1 deletion charts/cluster-api-cluster-openstack/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ Workload failure domain.
Workload volume failure domain.
*/}}
{{- define "openstack.failureDomain.volume.workload" -}}
{{ .pool.machine.disk.failureDomain | default .values.openstack.volumeFailureDomain }}
{{- if .pool.machine.disk.failureDomain -}}
{{ .pool.machine.disk.failureDomain }}
{{- else if .values.openstack.volumeFailureDomain -}}
{{ .values.openstack.volumeFailureDomain }}
{{- end }}
{{- end }}

{{/*
Expand Down
5 changes: 4 additions & 1 deletion charts/cluster-api-cluster-openstack/templates/workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ spec:
{{- end }}
{{- with $disk := $pool.machine.disk }}
rootVolume:
availabilityZone: {{ include "openstack.failureDomain.volume.workload" $context }}
sizeGiB: {{ $disk.size }}
{{- with $availabilityZone := (include "openstack.failureDomain.volume.workload" $context) }}
availabilityZone:
name: {{ $availabilityZone }}
{{- end }}
{{- end }}
{{- with $cluster := $.Values.cluster -}}
{{- with $metadata := $cluster.serverMetadata -}}
Expand Down

0 comments on commit 5464680

Please sign in to comment.