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 Jun 4, 2024
1 parent 6b91012 commit 14fe1e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cluster-autoscaler/cloudprovider/mcm/mcm_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ type nodeTemplate struct {
InstanceType *instanceType
Region string
Zone string
Architecture string
Architecture *string
Labels map[string]string
Taints []apiv1.Taint
}
Expand Down Expand Up @@ -787,7 +787,9 @@ func (m *McmManager) GetMachineDeploymentNodeTemplate(machinedeployment *Machine
instance.InstanceType = nodeTemplateAttributes.InstanceType
region = nodeTemplateAttributes.Region
zone = nodeTemplateAttributes.Zone
architecture = nodeTemplateAttributes.Architecture
if nodeTemplateAttributes.Architecture != nil {
architecture = *nodeTemplateAttributes.Architecture
}
break
}

Expand Down Expand Up @@ -860,7 +862,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 Expand Up @@ -976,9 +978,9 @@ func (m *McmManager) buildNodeFromTemplate(name string, template *nodeTemplate)
func buildGenericLabels(template *nodeTemplate, nodeName string) map[string]string {
result := make(map[string]string)
// TODO: extract from MCM
if template.Architecture != "" {
result[kubeletapis.LabelArch] = template.Architecture
result[apiv1.LabelArchStable] = template.Architecture
if template.Architecture != nil {
result[kubeletapis.LabelArch] = *template.Architecture
result[apiv1.LabelArchStable] = *template.Architecture
} else {
result[kubeletapis.LabelArch] = cloudprovider.DefaultArch
result[apiv1.LabelArchStable] = cloudprovider.DefaultArch
Expand Down

0 comments on commit 14fe1e8

Please sign in to comment.