Skip to content

Commit

Permalink
Fix error in creating aws copy snaphot request (#2042)
Browse files Browse the repository at this point in the history
* Upgrade aws-sdk-go back to v1.44.250

* Un-skip blockstorage snapshot copy test - expect to fail due to aws sdk upgrade

* Change presignURL coppysnapshot request client

* fix go sum with go mod tidy

* remove skip statement instead of comment it out

---------

Co-authored-by: Le Tran <le.tran@kasten.io>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed May 2, 2023
1 parent 6fe3590 commit 28ccf53
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/IBM/ibmcloud-storage-volume-lib v1.0.2-beta02.0.20190828145158-1da4543a60af
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/aws/aws-sdk-go v1.44.244
github.com/aws/aws-sdk-go v1.44.250
github.com/dustin/go-humanize v1.0.1
github.com/go-logr/logr v1.2.4
github.com/go-openapi/strfmt v0.21.7
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.44.244 h1:QzBWLD5HjZHdRZyTMTOWtD9Pobzf1n8/CeTJB4giXi0=
github.com/aws/aws-sdk-go v1.44.244/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.250 h1:IuGUO2Hafv/b0yYKI5UPLQShYDx50BCIQhab/H1sX2M=
github.com/aws/aws-sdk-go v1.44.250/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down
6 changes: 1 addition & 5 deletions pkg/blockstorage/awsebs/awsebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,12 @@ func (s *EbsStorage) SnapshotCopy(ctx context.Context, from, to blockstorage.Sna
// 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())
if err2 != nil {
return nil, errors.Wrap(err2, "Could not create client to presign URL for snapshot copy request")
}
si := ec2.CopySnapshotInput{
SourceSnapshotId: aws.String(from.ID),
SourceRegion: aws.String(from.Region),
DestinationRegion: ec2Cli.Config.Region,
}
rq, _ := fromCli.CopySnapshotRequest(&si)
rq, _ := ec2Cli.CopySnapshotRequest(&si)
su, err2 := rq.Presign(120 * time.Minute)
if err2 != nil {
return nil, errors.Wrap(err2, "Could not presign URL for snapshot copy request")
Expand Down
2 changes: 0 additions & 2 deletions pkg/blockstorage/blockstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ func (s *BlockStorageProviderSuite) TestCreateSnapshot(c *C) {
}

func (s *BlockStorageProviderSuite) TestSnapshotCopy(c *C) {
c.Skip("Sometimes, snapcopy takes over 10 minutes. go test declares failure if tests are that slow.")

var snap *blockstorage.Snapshot
var err error
srcSnapshot := s.createSnapshot(c)
Expand Down

0 comments on commit 28ccf53

Please sign in to comment.