Skip to content

Commit

Permalink
Merge pull request #4579 from Skarlso/fix-tag-order
Browse files Browse the repository at this point in the history
fix: sorting the tags list to make it determined
  • Loading branch information
k8s-ci-robot authored Oct 16, 2023
2 parents 076f360 + a900cec commit 5d1cb0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cloud/services/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"net/url"
"path"
"sort"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
Expand Down Expand Up @@ -272,6 +273,10 @@ func (s *Service) tagBucket(bucketName string) error {
})
}

sort.Slice(taggingInput.Tagging.TagSet, func(i, j int) bool {
return *taggingInput.Tagging.TagSet[i].Key < *taggingInput.Tagging.TagSet[j].Key
})

_, err := s.S3Client.PutBucketTagging(taggingInput)
if err != nil {
return err
Expand Down

0 comments on commit 5d1cb0f

Please sign in to comment.