mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Merge pull request #92505 from DataDog/jb/az-cloud-init
azure: use the parsed value from the configuration
This commit is contained in:
commit
5fe980beff
@ -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