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 6a7d014 commit 4a03d90
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 4a03d90

Please sign in to comment.