Skip to content

Commit

Permalink
Add validation for modifications to availability zones
Browse files Browse the repository at this point in the history
Updating Availability Zone is not allowed for Azure AKS.

Issue: #669
(cherry picked from commit cb67801)
  • Loading branch information
mjura committed Oct 1, 2024
1 parent 947a102 commit 8f4a309
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/aks-cluster-config-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,9 @@ func (h *Handler) updateUpstreamClusterState(ctx context.Context, config *aksv1.
logrus.Debugf("config: %s; upstream: %s", np.Mode, upstreamNodePool.Mode)
updateNodePool = true
}
if np.AvailabilityZones != nil && !reflect.DeepEqual(np.AvailabilityZones, upstreamNodePool.AvailabilityZones) {
logrus.Errorf("Changing availability zones for node pool [%s] in cluster [%s (id: %s)] is not permitted", aks.String(np.Name), config.Spec.ClusterName, config.Name)
}
} else {
logrus.Infof("Adding node pool [%s] for cluster [%s (id: %s)]", aks.String(np.Name), config.Spec.ClusterName, config.Name)
updateNodePool = true
Expand Down

0 comments on commit 8f4a309

Please sign in to comment.