From a454720f655dca0d5c7ea8c2fd3f3b4db7a58ce4 Mon Sep 17 00:00:00 2001 From: wenxuanW Date: Mon, 8 Apr 2024 17:46:05 -0700 Subject: [PATCH] Add const --- cluster-autoscaler/cloudprovider/azure/azure_cache.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_cache.go b/cluster-autoscaler/cloudprovider/azure/azure_cache.go index 798832864e9c..17fc9e563933 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_cache.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_cache.go @@ -195,9 +195,10 @@ func (m *azureCache) fetchAzureResources() error { } const ( - agentpoolNameTag = "aks-managed-poolName" - agentpoolTypeTag = "aks-managed-agentpool-type" - vmsPoolType = "VirtualMachines" + legacyAgentpoolNameTag = "poolName" + agentpoolNameTag = "aks-managed-poolName" + agentpoolTypeTag = "aks-managed-agentpool-type" + vmsPoolType = "VirtualMachines" ) // fetchVirtualMachines returns the updated list of virtual machines in the config resource group using the Azure API. @@ -223,7 +224,7 @@ func (m *azureCache) fetchVirtualMachines() (map[string][]compute.VirtualMachine vmPoolName := tags[agentpoolNameTag] // fall back to legacy tag name if not found if vmPoolName == nil { - vmPoolName = tags["poolName"] + vmPoolName = tags[legacyAgentpoolNameTag] } if vmPoolName == nil {