From 8f991bdcf93d9a13c7787988173713ad1a263bae Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:52:30 +0500 Subject: [PATCH] fix test_lifecycle_get --- weed/s3api/s3api_bucket_handlers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go index e3fa778a5..b01150e81 100644 --- a/weed/s3api/s3api_bucket_handlers.go +++ b/weed/s3api/s3api_bucket_handlers.go @@ -8,6 +8,7 @@ import ( "fmt" "math" "net/http" + "sort" "strings" "time" @@ -346,7 +347,9 @@ func (s3a *S3ApiServer) GetBucketLifecycleConfigurationHandler(w http.ResponseWr Expiration: Expiration{Days: days, set: true}, }) } - + sort.Slice(response.Rules, func(i, j int) bool { + return response.Rules[i].ID < response.Rules[j].ID + }) writeSuccessResponseXML(w, r, response) }