Skip to content

Commit 5d1cb0f

Browse files
authored
Merge pull request #4579 from Skarlso/fix-tag-order
fix: sorting the tags list to make it determined
2 parents 076f360 + a900cec commit 5d1cb0f

File tree

1 file changed

+5
-0
lines changed
  • pkg/cloud/services/s3

1 file changed

+5
-0
lines changed

pkg/cloud/services/s3/s3.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"net/url"
2424
"path"
25+
"sort"
2526

2627
"github.com/aws/aws-sdk-go/aws"
2728
"github.com/aws/aws-sdk-go/aws/awserr"
@@ -272,6 +273,10 @@ func (s *Service) tagBucket(bucketName string) error {
272273
})
273274
}
274275

276+
sort.Slice(taggingInput.Tagging.TagSet, func(i, j int) bool {
277+
return *taggingInput.Tagging.TagSet[i].Key < *taggingInput.Tagging.TagSet[j].Key
278+
})
279+
275280
_, err := s.S3Client.PutBucketTagging(taggingInput)
276281
if err != nil {
277282
return err

0 commit comments

Comments
 (0)