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: rancher#669
  • Loading branch information
mjura committed Oct 1, 2024
1 parent 49e3fad commit cb67801
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 @@ -934,6 +934,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 cb67801

Please sign in to comment.