Skip to content

Commit

Permalink
Merge pull request #4571 from marwanad/update-azure-provider
Browse files Browse the repository at this point in the history
increase azclients polling delays
  • Loading branch information
k8s-ci-robot authored Jan 29, 2022
2 parents a393fe2 + a8f4981 commit 223a9e0
Show file tree
Hide file tree
Showing 2,008 changed files with 132,947 additions and 24,593 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"sync"
"time"

"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/client-go/tools/cache"
"k8s.io/utils/clock"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/client-go/tools/cache"
test_clock "k8s.io/utils/clock/testing"
)

func TestInstanceTypeCache(t *testing.T) {
Expand Down Expand Up @@ -64,7 +64,7 @@ func TestLTVersionChange(t *testing.T) {
})
}

fakeClock := clock.NewFakeClock(time.Unix(0, 0))
fakeClock := test_clock.NewFakeClock(time.Unix(0, 0))
fakeStore := cache.NewFakeExpirationStore(
func(obj interface{}) (s string, e error) {
return obj.(instanceTypeCachedObject).name, nil
Expand Down
4 changes: 4 additions & 0 deletions cluster-autoscaler/cloudprovider/azure/azure_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,16 @@ func overrideDefaultRateLimitConfig(defaults, config *azclients.RateLimitConfig)
}

func (cfg *Config) getAzureClientConfig(authorizer autorest.Authorizer, env *azure.Environment) *azclients.ClientConfig {
pollingDelay := 30 * time.Second
azClientConfig := &azclients.ClientConfig{
Location: cfg.Location,
SubscriptionID: cfg.SubscriptionID,
ResourceManagerEndpoint: env.ResourceManagerEndpoint,
Authorizer: authorizer,
Backoff: &retry.Backoff{Steps: 1},
RestClientConfig: azclients.RestClientConfig{
PollingDelay: &pollingDelay,
},
}

if cfg.CloudProviderBackoff {
Expand Down
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/azure/azure_scale_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func (scaleSet *ScaleSet) DeleteInstances(instances []*azureRef, hasUnregistered

scaleSet.instanceMutex.Lock()
klog.V(3).Infof("Calling virtualMachineScaleSetsClient.DeleteInstancesAsync(%v)", requiredIds.InstanceIds)
future, rerr := scaleSet.manager.azClient.virtualMachineScaleSetsClient.DeleteInstancesAsync(ctx, resourceGroup, commonAsg.Id(), *requiredIds)
future, rerr := scaleSet.manager.azClient.virtualMachineScaleSetsClient.DeleteInstancesAsync(ctx, resourceGroup, commonAsg.Id(), *requiredIds, false)
scaleSet.instanceMutex.Unlock()
if rerr != nil {
klog.Errorf("virtualMachineScaleSetsClient.DeleteInstancesAsync for instances %v failed: %v", requiredIds.InstanceIds, rerr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func TestDeleteNodes(t *testing.T) {

mockVMSSClient := mockvmssclient.NewMockInterface(ctrl)
mockVMSSClient.EXPECT().List(gomock.Any(), manager.config.ResourceGroup).Return(expectedScaleSets, nil).Times(2)
mockVMSSClient.EXPECT().DeleteInstancesAsync(gomock.Any(), manager.config.ResourceGroup, gomock.Any(), gomock.Any()).Return(nil, nil)
mockVMSSClient.EXPECT().DeleteInstancesAsync(gomock.Any(), manager.config.ResourceGroup, gomock.Any(), gomock.Any(), false).Return(nil, nil)
mockVMSSClient.EXPECT().WaitForDeleteInstancesResult(gomock.Any(), gomock.Any(), manager.config.ResourceGroup).Return(&http.Response{StatusCode: http.StatusOK}, nil).AnyTimes()
manager.azClient.virtualMachineScaleSetsClient = mockVMSSClient
mockVMSSVMClient := mockvmssvmclient.NewMockInterface(ctrl)
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestDeleteNodeUnregistered(t *testing.T) {

mockVMSSClient := mockvmssclient.NewMockInterface(ctrl)
mockVMSSClient.EXPECT().List(gomock.Any(), manager.config.ResourceGroup).Return(expectedScaleSets, nil).Times(2)
mockVMSSClient.EXPECT().DeleteInstancesAsync(gomock.Any(), manager.config.ResourceGroup, gomock.Any(), gomock.Any()).Return(nil, nil)
mockVMSSClient.EXPECT().DeleteInstancesAsync(gomock.Any(), manager.config.ResourceGroup, gomock.Any(), gomock.Any(), false).Return(nil, nil)
mockVMSSClient.EXPECT().WaitForDeleteInstancesResult(gomock.Any(), gomock.Any(), manager.config.ResourceGroup).Return(&http.Response{StatusCode: http.StatusOK}, nil).AnyTimes()
manager.azClient.virtualMachineScaleSetsClient = mockVMSSClient
mockVMSSVMClient := mockvmssvmclient.NewMockInterface(ctrl)
Expand Down
88 changes: 44 additions & 44 deletions cluster-autoscaler/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.16
require (
cloud.google.com/go v0.81.0
github.com/Azure/azure-sdk-for-go v55.8.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.19
github.com/Azure/go-autorest/autorest/adal v0.9.14
github.com/Azure/go-autorest/autorest v0.11.22
github.com/Azure/go-autorest/autorest/adal v0.9.17
github.com/Azure/go-autorest/autorest/azure/auth v0.5.8
github.com/Azure/go-autorest/autorest/date v0.3.0
github.com/Azure/go-autorest/autorest/to v0.4.0
Expand All @@ -16,30 +16,30 @@ require (
github.com/golang/mock v1.6.0
github.com/google/uuid v1.1.2
github.com/jmespath/go-jmespath v0.4.0
github.com/json-iterator/go v1.1.11
github.com/json-iterator/go v1.1.12
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/satori/go.uuid v1.2.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
google.golang.org/api v0.46.0
gopkg.in/gcfg.v1 v1.2.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.23.0-alpha.1
k8s.io/apimachinery v0.23.0-alpha.1
k8s.io/apiserver v0.23.0-alpha.1
k8s.io/client-go v0.23.0-alpha.1
k8s.io/cloud-provider v0.23.0-alpha.1
k8s.io/component-base v0.23.0-alpha.1
k8s.io/component-helpers v0.23.0-alpha.1
k8s.io/klog/v2 v2.10.0
k8s.io/kubelet v0.0.0
k8s.io/kubernetes v1.23.0-alpha.1
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/apiserver v0.23.0
k8s.io/client-go v0.23.0
k8s.io/cloud-provider v0.23.0
k8s.io/component-base v0.23.0
k8s.io/component-helpers v0.23.0
k8s.io/klog/v2 v2.30.0
k8s.io/kubelet v0.23.0
k8s.io/kubernetes v1.23.0
k8s.io/legacy-cloud-providers v0.0.0
k8s.io/utils v0.0.0-20210802155522-efc7438f0176
sigs.k8s.io/cloud-provider-azure v1.1.3
k8s.io/utils v0.0.0-20211116205334-6203023598ed
sigs.k8s.io/cloud-provider-azure v1.23.2
)

replace github.com/aws/aws-sdk-go/service/eks => github.com/aws/aws-sdk-go/service/eks v1.38.49
Expand All @@ -48,56 +48,56 @@ replace github.com/digitalocean/godo => github.com/digitalocean/godo v1.27.0

replace github.com/rancher/go-rancher => github.com/rancher/go-rancher v0.1.0

replace k8s.io/api => k8s.io/api v0.23.0-alpha.1
replace k8s.io/api => k8s.io/api v0.23.0

replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.0-alpha.1
replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.0

replace k8s.io/apimachinery => k8s.io/apimachinery v0.23.0-alpha.1
replace k8s.io/apimachinery => k8s.io/apimachinery v0.23.0

replace k8s.io/apiserver => k8s.io/apiserver v0.23.0-alpha.1
replace k8s.io/apiserver => k8s.io/apiserver v0.23.0

replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.0-alpha.1
replace k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.0

replace k8s.io/client-go => k8s.io/client-go v0.23.0-alpha.1
replace k8s.io/client-go => k8s.io/client-go v0.23.0

replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.0-alpha.1
replace k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.0

replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.0-alpha.1
replace k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.0

replace k8s.io/code-generator => k8s.io/code-generator v0.23.0-alpha.1
replace k8s.io/code-generator => k8s.io/code-generator v0.23.0

replace k8s.io/component-base => k8s.io/component-base v0.23.0-alpha.1
replace k8s.io/component-base => k8s.io/component-base v0.23.0

replace k8s.io/component-helpers => k8s.io/component-helpers v0.23.0-alpha.1
replace k8s.io/component-helpers => k8s.io/component-helpers v0.23.0

replace k8s.io/controller-manager => k8s.io/controller-manager v0.23.0-alpha.1
replace k8s.io/controller-manager => k8s.io/controller-manager v0.23.0

replace k8s.io/cri-api => k8s.io/cri-api v0.23.0-alpha.1
replace k8s.io/cri-api => k8s.io/cri-api v0.23.0

replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.0-alpha.1
replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.0

replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.0-alpha.1
replace k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.0

replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.0-alpha.1
replace k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.0

replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.0-alpha.1
replace k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.0

replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.0-alpha.1
replace k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.0

replace k8s.io/kubectl => k8s.io/kubectl v0.23.0-alpha.1
replace k8s.io/kubectl => k8s.io/kubectl v0.23.0

replace k8s.io/kubelet => k8s.io/kubelet v0.23.0-alpha.1
replace k8s.io/kubelet => k8s.io/kubelet v0.23.0

replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.0-alpha.1
replace k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.0

replace k8s.io/metrics => k8s.io/metrics v0.23.0-alpha.1
replace k8s.io/metrics => k8s.io/metrics v0.23.0

replace k8s.io/mount-utils => k8s.io/mount-utils v0.23.0-alpha.1
replace k8s.io/mount-utils => k8s.io/mount-utils v0.23.0

replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.0-alpha.1
replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.0

replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.23.0-alpha.1
replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.23.0

replace k8s.io/sample-controller => k8s.io/sample-controller v0.23.0-alpha.1
replace k8s.io/sample-controller => k8s.io/sample-controller v0.23.0

replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.0-alpha.1
replace k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.0
Loading

0 comments on commit 223a9e0

Please sign in to comment.