mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
azure: use the parsed value from the configuration
Signed-off-by: Julien Balestra <julien.balestra@datadoghq.com>
This commit is contained in:
parent
4a91ecb976
commit
5f5eea4a24
@ -391,7 +391,7 @@ func (az *Cloud) InitializeCloudFromConfig(config *Config, fromSecret bool) erro
|
|||||||
// No credentials provided, useInstanceMetadata should be enabled for Kubelet.
|
// No credentials provided, useInstanceMetadata should be enabled for Kubelet.
|
||||||
// TODO(feiskyer): print different error message for Kubelet and controller-manager, as they're
|
// TODO(feiskyer): print different error message for Kubelet and controller-manager, as they're
|
||||||
// requiring different credential settings.
|
// requiring different credential settings.
|
||||||
if !config.UseInstanceMetadata && az.Config.CloudConfigType == cloudConfigTypeFile {
|
if !config.UseInstanceMetadata && config.CloudConfigType == cloudConfigTypeFile {
|
||||||
return fmt.Errorf("useInstanceMetadata must be enabled without Azure credentials")
|
return fmt.Errorf("useInstanceMetadata must be enabled without Azure credentials")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3324,8 +3324,8 @@ func TestInitializeCloudFromConfig(t *testing.T) {
|
|||||||
AzureAuthConfig: auth.AzureAuthConfig{
|
AzureAuthConfig: auth.AzureAuthConfig{
|
||||||
Cloud: "AZUREPUBLICCLOUD",
|
Cloud: "AZUREPUBLICCLOUD",
|
||||||
},
|
},
|
||||||
|
CloudConfigType: cloudConfigTypeFile,
|
||||||
}
|
}
|
||||||
az.Config.CloudConfigType = cloudConfigTypeFile
|
|
||||||
err = az.InitializeCloudFromConfig(&config, false)
|
err = az.InitializeCloudFromConfig(&config, false)
|
||||||
expectedErr = fmt.Errorf("useInstanceMetadata must be enabled without Azure credentials")
|
expectedErr = fmt.Errorf("useInstanceMetadata must be enabled without Azure credentials")
|
||||||
assert.Equal(t, expectedErr, err)
|
assert.Equal(t, expectedErr, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user