From f7b4db9ee1867a0149901b8f6606c0b964c79cd1 Mon Sep 17 00:00:00 2001 From: Alex Leites <18728999+tallaxes@users.noreply.github.com> Date: Sun, 8 Dec 2024 01:23:04 +0000 Subject: [PATCH 1/2] fix: setting getVmssSizeRefreshPeriod --- cluster-autoscaler/cloudprovider/azure/azure_scale_set.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go b/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go index 9c789ecb87ae..64d5b93a2c8b 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_scale_set.go @@ -123,7 +123,7 @@ func NewScaleSet(spec *dynamic.NodeGroupSpec, az *AzureManager, curSize int64, d if az.config.GetVmssSizeRefreshPeriod != 0 { scaleSet.getVmssSizeRefreshPeriod = time.Duration(az.config.GetVmssSizeRefreshPeriod) * time.Second } else { - scaleSet.getVmssSizeRefreshPeriod = time.Duration(az.azureCache.refreshInterval) * time.Second + scaleSet.getVmssSizeRefreshPeriod = az.azureCache.refreshInterval } if az.config.EnableDetailedCSEMessage { From cbf930a26a668ad34908aaa16cef70d455c35573 Mon Sep 17 00:00:00 2001 From: Alex Leites <18728999+tallaxes@users.noreply.github.com> Date: Sun, 8 Dec 2024 02:22:02 +0000 Subject: [PATCH 2/2] fix: corresponding test --- cluster-autoscaler/cloudprovider/azure/azure_manager_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_manager_test.go b/cluster-autoscaler/cloudprovider/azure/azure_manager_test.go index d214e16c83de..a87301af88b2 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_manager_test.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_manager_test.go @@ -1038,7 +1038,7 @@ func TestGetFilteredAutoscalingGroupsVmss(t *testing.T) { enableForceDelete: manager.config.EnableForceDelete, curSize: 3, sizeRefreshPeriod: manager.azureCache.refreshInterval, - getVmssSizeRefreshPeriod: time.Duration(manager.azureCache.refreshInterval) * time.Second, + getVmssSizeRefreshPeriod: manager.azureCache.refreshInterval, InstanceCache: InstanceCache{instancesRefreshPeriod: defaultVmssInstancesRefreshPeriod}, }} assert.True(t, assert.ObjectsAreEqualValues(expectedAsgs, asgs), "expected %#v, but found: %#v", expectedAsgs, asgs)