Skip to content

Commit

Permalink
Give EBS endpoint precedence over region
Browse files Browse the repository at this point in the history
If a user has configured an endpoint to use for AWS, always use it,
rather than deferring to an auto-generated endpoint based on the region.
  • Loading branch information
codenrhoden committed Dec 19, 2017
1 parent e190be1 commit 750ce0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libstorage/drivers/storage/ebs/storage/ebs_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ func (d *driver) Login(ctx types.Context) (interface{}, error) {
region = d.mustRegion(ctx)
)

if region != nil {
if d.endpoint != nil {
endpoint = d.endpoint
} else {
szEndpint := fmt.Sprintf("ec2.%s.amazonaws.com", *region)
endpoint = &szEndpint
} else {
endpoint = d.endpoint
}

writeHkey(hkey, region)
Expand Down

0 comments on commit 750ce0e

Please sign in to comment.