mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 00:31:00 +00:00
test: azure: check error for cloud detection.
If something goes wrong during the Azure cloud detection, trying to cast the returned value will result in the following panic and give no clue as to what the error was. ``` panic: interface conversion: cloudprovider.Interface is nil, not *azure.Cloud goroutine 1 [running]: k8s.io/kubernetes/test/e2e/framework/providers/azure.newProvider() test/e2e/framework/providers/azure/azure.go:50 +0x2b5 k8s.io/kubernetes/test/e2e/framework.SetupProviderConfig({0xc0007966b8, 0x5}) test/e2e/framework/provider.go:82 +0x1a6 ```
This commit is contained in:
parent
406d2dfe61
commit
9f5b6db8be
@ -46,9 +46,12 @@ func newProvider() (framework.ProviderInterface, error) {
|
||||
defer config.Close()
|
||||
}
|
||||
azureCloud, err := azure.NewCloud(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Provider{
|
||||
azureCloud: azureCloud.(*azure.Cloud),
|
||||
}, err
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Provider is a structure to handle Azure clouds for e2e testing
|
||||
|
Loading…
Reference in New Issue
Block a user