Skip to content

Commit

Permalink
fix: respect availability_zone for control plane (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Mar 8, 2024
1 parent f896818 commit 6803bd3
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,34 @@ def get_object(self) -> objects.ClusterClass:
},
],
},
{
"name": "controlPlaneAvailabilityZone",
"enabledIf": '{{ if ne .availabilityZone "" }}true{{end}}',
"definitions": [
{
"selector": {
"apiVersion": objects.OpenStackClusterTemplate.version,
"kind": objects.OpenStackClusterTemplate.kind,
"matchResources": {
"infrastructureCluster": True,
},
},
"jsonPatches": [
{
"op": "add",
"path": "/spec/template/spec/controlPlaneAvailabilityZones",
"valueFrom": {
"template": textwrap.dedent(
"""\
- "{{ .availabilityZone }}"
"""
),
},
},
],
},
],
},
{
"name": "newNetworkConfig",
"enabledIf": '{{ if eq .fixedNetworkName "" }}true{{end}}',
Expand Down Expand Up @@ -1993,7 +2021,9 @@ def generate_machine_deployments_for_cluster(
"node.cluster.x-k8s.io/nodegroup": ng.name,
},
},
"failureDomain": utils.get_cluster_label(cluster, "availability_zone", ""),
"failureDomain": utils.get_node_group_label(
context, ng, "availability_zone", ""
),
"machineHealthCheck": {
"enable": utils.get_cluster_label_as_bool(
cluster, "auto_healing_enabled", True
Expand Down Expand Up @@ -2349,8 +2379,7 @@ def get_object(self) -> objects.Cluster:
"name": "availabilityZone",
"value": utils.get_cluster_label(
self.cluster, "availability_zone", ""
)
or "",
),
},
{
"name": "enableKeystoneAuth",
Expand Down

0 comments on commit 6803bd3

Please sign in to comment.