Skip to content

Commit

Permalink
Merge pull request #4973 from olagacek/master
Browse files Browse the repository at this point in the history
Handle gracefully empty arch in kube env.
k8s-ci-robot authored Jun 15, 2022
2 parents ccd9b6b + 2592738 commit 9a76079
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/gce/templates.go
Original file line number Diff line number Diff line change
@@ -599,7 +599,7 @@ func ToSystemArchitecture(arch string) SystemArchitecture {
case string(Amd64):
return Amd64
default:
return UnknownArch
return DefaultArch
}
}

9 changes: 9 additions & 0 deletions cluster-autoscaler/cloudprovider/gce/templates_test.go
Original file line number Diff line number Diff line change
@@ -170,6 +170,15 @@ func TestBuildNodeFromTemplateSetsResources(t *testing.T) {
attachedLocalSSDCount: 4,
expectedErr: false,
},
{
scenario: "handle empty arch gracefully",
kubeEnv: "AUTOSCALER_ENV_VARS: os_distribution=cos;arch=;os=linux;ephemeral_storage_local_ssd_count=2\n",
physicalCpu: 8,
physicalMemory: 200 * units.MiB,
ephemeralStorageLocalSSDCount: 2,
attachedLocalSSDCount: 4,
expectedErr: false,
},
{
scenario: "ephemeral storage on local SSDs with kube-reserved",
kubeEnv: "AUTOSCALER_ENV_VARS: kube_reserved=cpu=0,memory=0,ephemeral-storage=10Gi;os_distribution=cos;os=linux;ephemeral_storage_local_ssd_count=2\n",

0 comments on commit 9a76079

Please sign in to comment.