mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +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
|
// ParseConfig returns a parsed configuration and azure.Environment for an Azure cloudprovider config file
|
||||||
func ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) {
|
func ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) {
|
||||||
var config Config
|
var config Config
|
||||||
|
var env azure.Environment
|
||||||
|
|
||||||
|
if configReader == nil {
|
||||||
|
return &config, &env, nil
|
||||||
|
}
|
||||||
|
|
||||||
configContents, err := ioutil.ReadAll(configReader)
|
configContents, err := ioutil.ReadAll(configReader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -337,7 +342,6 @@ func ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) {
|
|||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var env azure.Environment
|
|
||||||
if config.Cloud == "" {
|
if config.Cloud == "" {
|
||||||
env = azure.PublicCloud
|
env = azure.PublicCloud
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user