From 41d44225c9cbcbb0d917f2ab550fb9f917c36722 Mon Sep 17 00:00:00 2001 From: Harrison Affel Date: Fri, 1 Apr 2022 14:42:52 -0400 Subject: [PATCH] do not set agentProfile availability zones if the node pool does not define any --- pkg/aks/create.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/aks/create.go b/pkg/aks/create.go index e9566415..2fcd9c0e 100644 --- a/pkg/aks/create.go +++ b/pkg/aks/create.go @@ -83,8 +83,12 @@ func CreateOrUpdateCluster(ctx context.Context, cred *Credentials, clusterClient VMSize: containerservice.VMSizeTypes(np.VMSize), Mode: containerservice.AgentPoolMode(np.Mode), OrchestratorVersion: np.OrchestratorVersion, - AvailabilityZones: np.AvailabilityZones, } + + if np.AvailabilityZones != nil && len(*np.AvailabilityZones) > 0 { + agentProfile.AvailabilityZones = np.AvailabilityZones + } + if np.EnableAutoScaling != nil && *np.EnableAutoScaling { agentProfile.EnableAutoScaling = np.EnableAutoScaling agentProfile.MaxCount = np.MaxCount