Skip to content

Commit

Permalink
volume list ut fix (#931)
Browse files Browse the repository at this point in the history
  • Loading branch information
bathina2 committed Mar 12, 2021
1 parent 500854f commit cdd3716
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/blockstorage/awsebs/awsebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (s *EbsStorage) VolumesList(ctx context.Context, tags map[string]string, zo
var fltrs []*ec2.Filter
dvi := &ec2.DescribeVolumesInput{}
for k, v := range tags {
fltr := ec2.Filter{Name: &k, Values: []*string{&v}}
fltr := ec2.Filter{Name: aws.String("tag:" + k), Values: []*string{&v}}
fltrs = append(fltrs, &fltr)
}

Expand Down
7 changes: 1 addition & 6 deletions pkg/blockstorage/blockstorage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,8 @@ func (s *BlockStorageProviderSuite) TestSnapshotCopy(c *C) {
}

func (s *BlockStorageProviderSuite) testVolumesList(c *C) {
var tags map[string]string
var zone string
if s.provider.Type() == blockstorage.TypeGPD {
tags = map[string]string{"name": "*"}
} else {
tags = map[string]string{"status": "available"}
}
tags := map[string]string{"testtag": "testtagvalue"}
zone = s.storageAZ
vols, err := s.provider.VolumesList(context.Background(), tags, zone)
c.Assert(err, IsNil)
Expand Down

0 comments on commit cdd3716

Please sign in to comment.