Skip to content

Commit

Permalink
Fix a bug if there are multiple volume tags
Browse files Browse the repository at this point in the history
We cannot take the address of a range iteration variable because the
address of that will be the same.
  • Loading branch information
jieyu committed Oct 31, 2019
1 parent 06e8528 commit 423db9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ func (c *cloud) CreateDisk(ctx context.Context, volumeName string, diskOptions *

var tags []*ec2.Tag
for key, value := range diskOptions.Tags {
tags = append(tags, &ec2.Tag{Key: &key, Value: &value})
copiedKey := key
copiedValue := value
tags = append(tags, &ec2.Tag{Key: &copiedKey, Value: &copiedValue})
}
tagSpec := ec2.TagSpecification{
ResourceType: aws.String("volume"),
Expand Down

0 comments on commit 423db9b

Please sign in to comment.