mirror of https://github.com/k3s-io/k3s
Merge pull request #6370 from justinsb/aws_config_optional
Make AWS configuration file optional (fall-back to metadata service)pull/6/head
commit
f2f3da15e1
|
@ -119,14 +119,14 @@ func getAuth() (auth aws.Auth, err error) {
|
|||
|
||||
// readAWSCloudConfig reads an instance of AWSCloudConfig from config reader.
|
||||
func readAWSCloudConfig(config io.Reader, metadata AWSMetadata) (*AWSCloudConfig, error) {
|
||||
if config == nil {
|
||||
return nil, fmt.Errorf("no AWS cloud provider config file given")
|
||||
}
|
||||
|
||||
var cfg AWSCloudConfig
|
||||
err := gcfg.ReadInto(&cfg, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
var err error
|
||||
|
||||
if config != nil {
|
||||
err = gcfg.ReadInto(&cfg, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.Global.Zone == "" {
|
||||
|
|
Loading…
Reference in New Issue