Skip to content

Commit 5fe980b

Browse files
authored
Merge pull request kubernetes#92505 from DataDog/jb/az-cloud-init
azure: use the parsed value from the configuration
2 parents d114b5e + 5f5eea4 commit 5fe980b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/azure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ func (az *Cloud) InitializeCloudFromConfig(config *Config, fromSecret bool) erro
391391
// No credentials provided, useInstanceMetadata should be enabled for Kubelet.
392392
// TODO(feiskyer): print different error message for Kubelet and controller-manager, as they're
393393
// requiring different credential settings.
394-
if !config.UseInstanceMetadata && az.Config.CloudConfigType == cloudConfigTypeFile {
394+
if !config.UseInstanceMetadata && config.CloudConfigType == cloudConfigTypeFile {
395395
return fmt.Errorf("useInstanceMetadata must be enabled without Azure credentials")
396396
}
397397

staging/src/k8s.io/legacy-cloud-providers/azure/azure_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3324,8 +3324,8 @@ func TestInitializeCloudFromConfig(t *testing.T) {
33243324
AzureAuthConfig: auth.AzureAuthConfig{
33253325
Cloud: "AZUREPUBLICCLOUD",
33263326
},
3327+
CloudConfigType: cloudConfigTypeFile,
33273328
}
3328-
az.Config.CloudConfigType = cloudConfigTypeFile
33293329
err = az.InitializeCloudFromConfig(&config, false)
33303330
expectedErr = fmt.Errorf("useInstanceMetadata must be enabled without Azure credentials")
33313331
assert.Equal(t, expectedErr, err)

0 commit comments

Comments
 (0)