forked from TrueCloudLab/distribution
Fixes an IAM role authentication bug
More specifically, the driver panics if initialized with FromParameters with empty accesskey or secretkey.
This commit is contained in:
parent
75c1b2bae7
commit
34f86b9ad6
1 changed files with 8 additions and 2 deletions
|
@ -82,8 +82,14 @@ func FromParameters(parameters map[string]interface{}) (*Driver, error) {
|
|||
// Providing no values for these is valid in case the user is authenticating
|
||||
// with an IAM on an ec2 instance (in which case the instance credentials will
|
||||
// be summoned when GetAuth is called)
|
||||
accessKey, _ := parameters["accesskey"]
|
||||
secretKey, _ := parameters["secretkey"]
|
||||
accessKey, ok := parameters["accesskey"]
|
||||
if !ok {
|
||||
accessKey = ""
|
||||
}
|
||||
secretKey, ok := parameters["secretkey"]
|
||||
if !ok {
|
||||
secretKey = ""
|
||||
}
|
||||
|
||||
regionName, ok := parameters["region"]
|
||||
if !ok || fmt.Sprint(regionName) == "" {
|
||||
|
|
Loading…
Reference in a new issue