diff --git a/go.mod b/go.mod index 2433562df6..f50b2deb11 100644 --- a/go.mod +++ b/go.mod @@ -40,7 +40,7 @@ require ( k8s.io/pod-security-admission v0.32.1 k8s.io/utils v0.0.0-20241210054802-24370beab758 sigs.k8s.io/cloud-provider-azure v1.31.1-0.20250121182637-52f3eec818a6 - sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.13 + sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.14 sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.3.4 sigs.k8s.io/yaml v1.4.0 ) diff --git a/go.sum b/go.sum index dfeb2fbca8..a10b41ba07 100644 --- a/go.sum +++ b/go.sum @@ -884,8 +884,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcp sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= sigs.k8s.io/cloud-provider-azure v1.31.1-0.20250121182637-52f3eec818a6 h1:PsYLrAt+XIyuTuoiWX+fKjjaWu2FfApzzDisFn375MY= sigs.k8s.io/cloud-provider-azure v1.31.1-0.20250121182637-52f3eec818a6/go.mod h1:/yKrVzW3Sjkz3CxC2gUL7edtRidoT1vAzWqkitZ4GP0= -sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.13 h1:lLHCbEFOa1yb3TztMr+0T/54p9l/8Yx+8hsKvsLMu7U= -sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.13/go.mod h1:SUEQT6YJvFcXCQB1DI2uJhAlc7VFrh+SkeUJz0lpk24= +sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.14 h1:Hjwpu3YiO8lt05MfqyTDU/UMXYcVzKLfGBRFTa+1qnI= +sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.14/go.mod h1:SUEQT6YJvFcXCQB1DI2uJhAlc7VFrh+SkeUJz0lpk24= sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.3.0 h1:kV/Quek+qYIZu+qPK/IG9LwNN2yHv0ztnQeliEdzgFU= sigs.k8s.io/cloud-provider-azure/pkg/azclient/cache v0.3.0/go.mod h1:cuGeCMrfA2QJllr9THFoqZ9d1PKym+8VV5Tm6F5QBEg= sigs.k8s.io/cloud-provider-azure/pkg/azclient/configloader v0.3.4 h1:jGYTor8ENTHr0eJeqlf9JE8FjXAR+9iOfUPGNzhTKxk= diff --git a/vendor/modules.txt b/vendor/modules.txt index 316945be26..ab42ec038a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1889,7 +1889,7 @@ sigs.k8s.io/cloud-provider-azure/pkg/util/string sigs.k8s.io/cloud-provider-azure/pkg/util/taints sigs.k8s.io/cloud-provider-azure/pkg/util/vm sigs.k8s.io/cloud-provider-azure/pkg/version -# sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.13 +# sigs.k8s.io/cloud-provider-azure/pkg/azclient v0.4.14 ## explicit; go 1.23.1 sigs.k8s.io/cloud-provider-azure/pkg/azclient sigs.k8s.io/cloud-provider-azure/pkg/azclient/accountclient diff --git a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/cloud.go b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/cloud.go index f24c346d9d..5bf37b8f40 100644 --- a/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/cloud.go +++ b/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azclient/cloud.go @@ -35,6 +35,7 @@ var EnvironmentMapping = map[string]*cloud.Configuration{ "AZUREUSGOVERNMENTCLOUD": &cloud.AzureGovernment, //TODO: deprecate } +const AzureStackCloudName = "AZURESTACKCLOUD" const ( // EnvironmentFilepathName captures the name of the environment variable containing the path to the file // to be used while populating the Azure Environment. @@ -117,7 +118,10 @@ func OverrideAzureCloudConfigAndEnvConfigFromMetadataService(endpoint, cloudName return nil } -func OverrideAzureCloudConfigFromEnv(config *cloud.Configuration, env *Environment) error { +func OverrideAzureCloudConfigFromEnv(cloudName string, config *cloud.Configuration, env *Environment) error { + if !strings.EqualFold(cloudName, AzureStackCloudName) { + return nil + } envFilePath, ok := os.LookupEnv(EnvironmentFilepathName) if !ok { return nil @@ -156,7 +160,7 @@ func GetAzureCloudConfigAndEnvConfig(armConfig *ARMClientConfig) (cloud.Configur if err != nil { return *config, nil, err } - err = OverrideAzureCloudConfigFromEnv(config, env) + err = OverrideAzureCloudConfigFromEnv(cloudName, config, env) return *config, env, err }