Skip to content

Commit e7260ab

Browse files
committed
feat: allowing update of OpenstackCluster API server port
1 parent aa6dc32 commit e7260ab

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

api/v1alpha7/openstackcluster_webhook.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ func (r *OpenStackCluster) ValidateUpdate(oldRaw runtime.Object) error {
110110
r.Spec.APIServerFixedIP = ""
111111
}
112112

113+
// If API Server floating IP is disabled, allow the change of the API Server port only for the first time.
114+
if old.Spec.DisableAPIServerFloatingIP && old.Spec.APIServerPort == 0 && r.Spec.APIServerPort > 0 {
115+
r.Spec.APIServerPort = 0
116+
}
117+
113118
// Allow changes to the bastion spec.
114119
old.Spec.Bastion = &Bastion{}
115120
r.Spec.Bastion = &Bastion{}

0 commit comments

Comments
 (0)