mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
Merge pull request #93846 from knight42/fix/TestEnsureBackendPoolDeletedConcurrently
fix(azure): set default value of VmssVirtualMachinesCacheTTLInSeconds when initializing scaleSet
This commit is contained in:
commit
04362870ad
@ -83,13 +83,16 @@ type scaleSet struct {
|
||||
|
||||
// newScaleSet creates a new scaleSet.
|
||||
func newScaleSet(az *Cloud) (VMSet, error) {
|
||||
var err error
|
||||
if az.Config.VmssVirtualMachinesCacheTTLInSeconds == 0 {
|
||||
az.Config.VmssVirtualMachinesCacheTTLInSeconds = vmssVirtualMachinesCacheTTLDefaultInSeconds
|
||||
}
|
||||
ss := &scaleSet{
|
||||
Cloud: az,
|
||||
availabilitySet: newAvailabilitySet(az),
|
||||
vmssVMCache: &sync.Map{},
|
||||
}
|
||||
|
||||
var err error
|
||||
if !ss.DisableAvailabilitySetNodes {
|
||||
ss.availabilitySetNodesCache, err = ss.newAvailabilitySetNodesCache()
|
||||
if err != nil {
|
||||
|
@ -154,9 +154,6 @@ func (ss *scaleSet) gcVMSSVMCache() error {
|
||||
|
||||
// newVMSSVirtualMachinesCache instanciates a new VMs cache for VMs belonging to the provided VMSS.
|
||||
func (ss *scaleSet) newVMSSVirtualMachinesCache(resourceGroupName, vmssName, cacheKey string) (*azcache.TimedCache, error) {
|
||||
if ss.Config.VmssVirtualMachinesCacheTTLInSeconds == 0 {
|
||||
ss.Config.VmssVirtualMachinesCacheTTLInSeconds = vmssVirtualMachinesCacheTTLDefaultInSeconds
|
||||
}
|
||||
vmssVirtualMachinesCacheTTL := time.Duration(ss.Config.VmssVirtualMachinesCacheTTLInSeconds) * time.Second
|
||||
|
||||
getter := func(key string) (interface{}, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user