Skip to content

Commit

Permalink
Don't change roles in calls other than constructor. (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan Memisoglu committed Sep 11, 2019
1 parent 6c1cadc commit 7d56f3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/blockstorage/awsebs/awsebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ func (s *ebsStorage) SnapshotCopy(ctx context.Context, from, to blockstorage.Sna
return nil, errors.Errorf("Snapshot %v destination ID must be empty", to)
}
// Copy operation must be initiated from the destination region.
ec2Cli, err := newEC2Client(to.Region, s.ec2Cli.Config.Copy(), s.role)
ec2Cli, err := newEC2Client(to.Region, s.ec2Cli.Config.Copy(), "")
if err != nil {
return nil, errors.Wrapf(err, "Could not get EC2 client")
}
// Include a presigned URL when the regions are different. Include it
// independent of whether or not the snapshot is encrypted.
var presignedURL *string
if to.Region != from.Region {
fromCli, err2 := newEC2Client(from.Region, s.ec2Cli.Config.Copy(), s.role)
fromCli, err2 := newEC2Client(from.Region, s.ec2Cli.Config.Copy(), "")
if err2 != nil {
return nil, errors.Wrap(err2, "Could not create client to presign URL for snapshot copy request")
}
Expand Down Expand Up @@ -599,7 +599,7 @@ func (s *ebsStorage) FromRegion(ctx context.Context, region string) ([]string, e
}

func (s *ebsStorage) queryRegionToZones(ctx context.Context, region string) ([]string, error) {
ec2Cli, err := newEC2Client(region, s.ec2Cli.Config.Copy(), s.role)
ec2Cli, err := newEC2Client(region, s.ec2Cli.Config.Copy(), "")
if err != nil {
return nil, errors.Wrapf(err, "Could not get EC2 client")
}
Expand Down

0 comments on commit 7d56f3c

Please sign in to comment.