Skip to content

Commit

Permalink
Merge pull request kubernetes#4973 from olagacek/master
Browse files Browse the repository at this point in the history
Handle gracefully empty arch in kube env.
  • Loading branch information
k8s-ci-robot authored Jun 15, 2022
2 parents de77005 + 02b3904 commit d2c950d
Show file tree
Hide file tree
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
Expand Up @@ -599,7 +599,7 @@ func ToSystemArchitecture(arch string) SystemArchitecture {
case string(Amd64):
return Amd64
default:
return UnknownArch
return DefaultArch
}
}

Expand Down
9 changes: 9 additions & 0 deletions cluster-autoscaler/cloudprovider/gce/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d2c950d

Please sign in to comment.