From a900cec951553f940781a297f7bdcbf6cefe8694 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Mon, 16 Oct 2023 15:03:34 +0200 Subject: [PATCH] fix: sorting the tags list to make it determined --- pkg/cloud/services/s3/s3.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cloud/services/s3/s3.go b/pkg/cloud/services/s3/s3.go index a8d23fbcde..b485b43c95 100644 --- a/pkg/cloud/services/s3/s3.go +++ b/pkg/cloud/services/s3/s3.go @@ -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" @@ -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