aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLHHDZ <changlin.shi@ly.com>2022-12-12 14:49:57 +0800
committerGitHub <noreply@github.com>2022-12-11 22:49:57 -0800
commitbb289d7d69f27e0ccef72d727053889eb6e37f9e (patch)
tree53ba617e323e7c7077fb0e1a5cb011eb4593645a
parent438146249f50bf36b4c46ece02a430f44152777f (diff)
downloadseaweedfs-bb289d7d69f27e0ccef72d727053889eb6e37f9e.tar.xz
seaweedfs-bb289d7d69f27e0ccef72d727053889eb6e37f9e.zip
sort tags by key (#4047)
Signed-off-by: changlin.shi <changlin.shi@ly.com> Signed-off-by: changlin.shi <changlin.shi@ly.com>
-rw-r--r--weed/s3api/tags.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/s3api/tags.go b/weed/s3api/tags.go
index 0fc32241f..3df44fae0 100644
--- a/weed/s3api/tags.go
+++ b/weed/s3api/tags.go
@@ -5,6 +5,7 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/util"
"regexp"
+ "sort"
"strings"
)
@@ -39,6 +40,11 @@ func FromTags(tags map[string]string) (t *Tagging) {
Value: v,
})
}
+ if tagArr := t.TagSet.Tag; len(tagArr) > 0 {
+ sort.SliceStable(tagArr, func(i, j int) bool {
+ return tagArr[i].Key < tagArr[j].Key
+ })
+ }
return
}