mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
fix bug when azure cloud provider configuration file is not specified
This commit is contained in:
parent
acc19cafa4
commit
2cddfd0db9
@ -327,6 +327,11 @@ func NewCloud(configReader io.Reader) (cloudprovider.Interface, error) {
|
||||
// ParseConfig returns a parsed configuration and azure.Environment for an Azure cloudprovider config file
|
||||
func ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) {
|
||||
var config Config
|
||||
var env azure.Environment
|
||||
|
||||
if configReader == nil {
|
||||
return &config, &env, nil
|
||||
}
|
||||
|
||||
configContents, err := ioutil.ReadAll(configReader)
|
||||
if err != nil {
|
||||
@ -337,7 +342,6 @@ func ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
var env azure.Environment
|
||||
if config.Cloud == "" {
|
||||
env = azure.PublicCloud
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user