Skip to content

Commit

Permalink
do not set agentProfile availability zones if the node pool does not …
Browse files Browse the repository at this point in the history
…define any
  • Loading branch information
HarrisonWAffel committed Apr 1, 2022
1 parent 3693991 commit 41d4422
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/aks/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41d4422

Please sign in to comment.