diff --git a/cluster-autoscaler/cloudprovider/mcm/mcm_manager.go b/cluster-autoscaler/cloudprovider/mcm/mcm_manager.go index e3c5ee274a86..1c4ad1c810dc 100644 --- a/cluster-autoscaler/cloudprovider/mcm/mcm_manager.go +++ b/cluster-autoscaler/cloudprovider/mcm/mcm_manager.go @@ -28,6 +28,7 @@ import ( "flag" "fmt" v1appslister "k8s.io/client-go/listers/apps/v1" + "k8s.io/utils/pointer" "math/rand" "net/http" "os" @@ -734,7 +735,7 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine req, _ = labels.NewRequirement(nodegroupset.LabelWorkerPool, selection.Equals, list) region string zone string - architecture string + architecture *string instance instanceType machineClass = md.Spec.Template.Spec.Class nodeTemplateSpec = md.Spec.Template.Spec.NodeTemplateSpec @@ -786,9 +787,7 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine instance.InstanceType = nodeTemplateAttributes.InstanceType region = nodeTemplateAttributes.Region zone = nodeTemplateAttributes.Zone - if nodeTemplateAttributes.Architecture != nil { - architecture = *nodeTemplateAttributes.Architecture - } + architecture = nodeTemplateAttributes.Architecture break } @@ -814,7 +813,7 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine } region = providerSpec.Region zone = getZoneValueFromMCLabels(mc.Labels) - architecture = providerSpec.Tags[apiv1.LabelArchStable] + architecture = pointer.String(providerSpec.Tags[apiv1.LabelArchStable]) case providerAzure: var providerSpec *azureapis.AzureProviderSpec err = json.Unmarshal(mc.ProviderSpec.Raw, &providerSpec) @@ -837,7 +836,7 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine if providerSpec.Properties.Zone != nil { zone = providerSpec.Location + "-" + strconv.Itoa(*providerSpec.Properties.Zone) } - architecture = providerSpec.Tags["kubernetes.io_arch"] + architecture = pointer.String(providerSpec.Tags["kubernetes.io_arch"]) default: return nil, cloudprovider.ErrNotImplemented } @@ -861,7 +860,7 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine Zone: zone, // will be implemented in MCM Labels: labels, Taints: taints, - Architecture: &architecture, + Architecture: architecture, } return nodeTmpl, nil