Skip to content

Commit 010408d

Browse files
authored
Merge pull request #1769 from spjmurray/allow_cp_scheduling_changes
✨ Allow AZs to be Omitted at Runtime
2 parents 47b87c8 + 04ee2bb commit 010408d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

api/v1alpha8/openstackcluster_webhook.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ func (r *OpenStackCluster) ValidateUpdate(oldRaw runtime.Object) (admission.Warn
130130
old.Spec.ControlPlaneAvailabilityZones = []string{}
131131
r.Spec.ControlPlaneAvailabilityZones = []string{}
132132

133+
// Allow the scheduling to be changed from CAPI managed to Nova and
134+
// vice versa.
135+
old.Spec.ControlPlaneOmitAvailabilityZone = false
136+
r.Spec.ControlPlaneOmitAvailabilityZone = false
137+
133138
// Allow change to the allowAllInClusterTraffic.
134139
old.Spec.AllowAllInClusterTraffic = false
135140
r.Spec.AllowAllInClusterTraffic = false

api/v1alpha8/openstackcluster_webhook_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,21 @@ func TestOpenStackCluster_ValidateUpdate(t *testing.T) {
234234
},
235235
wantErr: false,
236236
},
237+
{
238+
name: "Modifying OpenstackCluster.Spec.ControlPlaneOmitAvailabilityZone is allowed",
239+
oldTemplate: &OpenStackCluster{
240+
Spec: OpenStackClusterSpec{
241+
CloudName: "foobar",
242+
},
243+
},
244+
newTemplate: &OpenStackCluster{
245+
Spec: OpenStackClusterSpec{
246+
CloudName: "foobar",
247+
ControlPlaneOmitAvailabilityZone: true,
248+
},
249+
},
250+
wantErr: false,
251+
},
237252
{
238253
name: "Changing OpenStackCluster.Spec.APIServerFixedIP is allowed when API Server Floating IP is disabled",
239254
oldTemplate: &OpenStackCluster{

0 commit comments

Comments
 (0)