Skip to content

Commit 4139ca8

Browse files
authored
Merge pull request #7580 from k8s-infra-cherrypick-robot/cherry-pick-7579-to-cluster-autoscaler-release-1.31
[cluster-autoscaler-release-1.31] fix: correctly set the default refresh period for VMSS size (used for Spot instances)
2 parents 8d053b1 + 851dd10 commit 4139ca8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cluster-autoscaler/cloudprovider/azure/azure_manager_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ func TestGetFilteredAutoscalingGroupsVmss(t *testing.T) {
10631063
enableForceDelete: manager.config.EnableForceDelete,
10641064
curSize: 3,
10651065
sizeRefreshPeriod: manager.azureCache.refreshInterval,
1066-
getVmssSizeRefreshPeriod: time.Duration(manager.azureCache.refreshInterval) * time.Second,
1066+
getVmssSizeRefreshPeriod: manager.azureCache.refreshInterval,
10671067
InstanceCache: InstanceCache{instancesRefreshPeriod: defaultVmssInstancesRefreshPeriod},
10681068
}}
10691069
assert.True(t, assert.ObjectsAreEqualValues(expectedAsgs, asgs), "expected %#v, but found: %#v", expectedAsgs, asgs)
@@ -1111,7 +1111,7 @@ func TestGetFilteredAutoscalingGroupsVmssWithConfiguredSizes(t *testing.T) {
11111111
enableForceDelete: manager.config.EnableForceDelete,
11121112
curSize: 3,
11131113
sizeRefreshPeriod: manager.azureCache.refreshInterval,
1114-
getVmssSizeRefreshPeriod: time.Duration(manager.azureCache.refreshInterval) * time.Second,
1114+
getVmssSizeRefreshPeriod: manager.azureCache.refreshInterval,
11151115
InstanceCache: InstanceCache{instancesRefreshPeriod: defaultVmssInstancesRefreshPeriod},
11161116
}}
11171117
assert.True(t, assert.ObjectsAreEqualValues(expectedAsgs, asgs), "expected %#v, but found: %#v", expectedAsgs, asgs)

cluster-autoscaler/cloudprovider/azure/azure_scale_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func NewScaleSet(spec *dynamic.NodeGroupSpec, az *AzureManager, curSize int64, d
123123
if az.config.GetVmssSizeRefreshPeriod != 0 {
124124
scaleSet.getVmssSizeRefreshPeriod = time.Duration(az.config.GetVmssSizeRefreshPeriod) * time.Second
125125
} else {
126-
scaleSet.getVmssSizeRefreshPeriod = time.Duration(az.azureCache.refreshInterval) * time.Second
126+
scaleSet.getVmssSizeRefreshPeriod = az.azureCache.refreshInterval
127127
}
128128

129129
if az.config.EnableDetailedCSEMessage {

0 commit comments

Comments
 (0)