Skip to content

Commit

Permalink
Added arch to nodetemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
sssash18 committed Jan 19, 2024
1 parent 631eee6 commit 5117256
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions cluster-autoscaler/cloudprovider/mcm/mcm_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"flag"
"fmt"
v1appslister "k8s.io/client-go/listers/apps/v1"
"k8s.io/utils/pointer"
"math/rand"
"net/http"
"os"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand All @@ -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)
Expand All @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit 5117256

Please sign in to comment.