Skip to content

Commit

Permalink
Update pkg/scalers/aws_sqs_queue_scaler.go
Browse files Browse the repository at this point in the history
Co-Authored-By: Ahmed ElSayed <[email protected]>
Former-commit-id: 95d8b8c
  • Loading branch information
yaron2 and ahmelsayed authored Jun 3, 2019
1 parent 17359ce commit 0c97198
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/scalers/aws_sqs_queue_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ func parseAwsSqsQueueMetadata(metadata, resolvedEnv map[string]string) (*awsSqsQ
} else {
meta.awsAccessKeyID = awsAccessKeyIDEnvVar
}

var keyName string
if keyName, ok := metadata["awsAccessKeyID"]; !ok || keyName == "" {
keyName = awsAccessKeyIDEnvVar
}

if val, ok := resolvedEnv[keyName]; ok && val != "" {
meta.awsAccessKeyID = val
} else {
return nil, fmt.Errorf("cannot find awsAccessKeyId named %s in pod environment", keyName)
}
if val, ok := resolvedEnv["awsSecretAccessKey"]; ok && val != "" {
meta.awsSecretAccessKey = val
} else {
Expand Down

0 comments on commit 0c97198

Please sign in to comment.