diff --git a/azure/services/agentpools/spec_test.go b/azure/services/agentpools/spec_test.go index e9dc4a8142d..c189a68c9f6 100644 --- a/azure/services/agentpools/spec_test.go +++ b/azure/services/agentpools/spec_test.go @@ -133,9 +133,9 @@ func sdkWithNodeTaints(nodeTaints *[]string) func(*containerservice.AgentPool) { } } -func sdkWithNodeLabels(nodeLabels map[string]*string) func(*armcontainerservice.AgentPool) { - return func(pool *armcontainerservice.AgentPool) { - pool.Properties.NodeLabels = nodeLabels +func sdkWithNodeLabels(nodeLabels map[string]*string) func(*containerservice.AgentPool) { + return func(pool *containerservice.AgentPool) { + pool.NodeLabels = nodeLabels } } @@ -320,16 +320,16 @@ func TestParameters(t *testing.T) { }, ), existing: sdkFakeAgentPool( - func(pool *armcontainerservice.AgentPool) { - pool.Properties.NodeLabels = map[string]*string{ - "fake-label": ptr.To("fake-value"), - "kubernetes.azure.com/scalesetpriority": ptr.To("spot"), + func(pool *containerservice.AgentPool) { + pool.NodeLabels = map[string]*string{ + "fake-label": pointer.String("fake-value"), + "kubernetes.azure.com/scalesetpriority": pointer.String("spot"), } }, sdkWithProvisioningState("Succeeded"), ), expected: sdkFakeAgentPool(sdkWithNodeLabels(map[string]*string{ - "kubernetes.azure.com/scalesetpriority": ptr.To("spot"), + "kubernetes.azure.com/scalesetpriority": pointer.String("spot"), })), expectedError: nil, }, @@ -346,7 +346,10 @@ func TestParameters(t *testing.T) { }, sdkWithProvisioningState("Succeeded"), ), - expected: sdkFakeAgentPool(sdkWithNodeTaints(make([]*string, 0))), + expected: sdkFakeAgentPool(sdkWithNodeTaints( + func() *[]string { + return &[]string{} + }())), expectedError: nil, }, { @@ -373,15 +376,19 @@ func TestParameters(t *testing.T) { }, ), existing: sdkFakeAgentPool( - func(pool *armcontainerservice.AgentPool) { - pool.Properties.NodeTaints = []*string{ - ptr.To(azureutil.AzureSystemNodeLabelPrefix + "-fake-taint"), - ptr.To("fake-old-taint"), + func(pool *containerservice.AgentPool) { + dummyTaints := []string{ + azureutil.AzureSystemNodeLabelPrefix + "-fake-taint", + "fake-old-taint", } + pool.NodeTaints = &dummyTaints }, sdkWithProvisioningState("Succeeded"), ), - expected: sdkFakeAgentPool(sdkWithNodeTaints([]*string{ptr.To(azureutil.AzureSystemNodeLabelPrefix + "-fake-taint")})), + expected: sdkFakeAgentPool(sdkWithNodeTaints(func() *[]string { + dummy := []string{azureutil.AzureSystemNodeLabelPrefix + "-fake-taint"} + return &dummy + }())), expectedError: nil, }, { @@ -429,7 +436,7 @@ func TestParameters(t *testing.T) { func(pool *AgentPoolSpec) { pool.NodeLabels = nil }, ), existing: sdkFakeAgentPool( - func(pool *armcontainerservice.AgentPool) { pool.Properties.NodeLabels = nil }, + func(pool *containerservice.AgentPool) { pool.NodeLabels = nil }, sdkWithProvisioningState("Succeeded"), ), expected: nil, @@ -497,8 +504,8 @@ func TestMergeSystemNodeLabels(t *testing.T) { name: "labels are nil when both the capz and aks labels are nil", capzLabels: nil, aksLabels: map[string]*string{ - "foo": ptr.To("bar"), - "hello": ptr.To("world"), + "foo": pointer.String("bar"), + "hello": pointer.String("world"), }, expected: map[string]*string{}, },