Commit b61fc222 authored by Justin Santa Barbara's avatar Justin Santa Barbara

Make AWS configuration file optional (fall-back to metadata service)

parent 3d1dfd47
...@@ -119,14 +119,14 @@ func getAuth() (auth aws.Auth, err error) { ...@@ -119,14 +119,14 @@ func getAuth() (auth aws.Auth, err error) {
// readAWSCloudConfig reads an instance of AWSCloudConfig from config reader. // readAWSCloudConfig reads an instance of AWSCloudConfig from config reader.
func readAWSCloudConfig(config io.Reader, metadata AWSMetadata) (*AWSCloudConfig, error) { 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 var cfg AWSCloudConfig
err := gcfg.ReadInto(&cfg, config) var err error
if err != nil {
return nil, err if config != nil {
err = gcfg.ReadInto(&cfg, config)
if err != nil {
return nil, err
}
} }
if cfg.Global.Zone == "" { if cfg.Global.Zone == "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment