[#534] Return error if bucket has no tag set
All checks were successful
/ Builds (push) Successful in 1m2s
/ Vulncheck (push) Successful in 1m8s
/ OCI image (push) Successful in 1m54s
/ Lint (push) Successful in 2m20s
/ Tests (push) Successful in 1m22s

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
Marina Biryukova 2025-03-17 15:50:34 +03:00 committed by Alexey Vanin
parent 01d95d8cf4
commit c9c7379835
3 changed files with 74 additions and 1 deletions

View file

@ -160,7 +160,12 @@ func (h *handler) GetBucketTaggingHandler(w http.ResponseWriter, r *http.Request
tagSet, err := h.obj.GetBucketTagging(ctx, bktInfo)
if err != nil {
h.logAndSendError(ctx, w, "could not get object tagging", reqInfo, err)
h.logAndSendError(ctx, w, "could not get bucket tagging", reqInfo, err)
return
}
if len(tagSet) == 0 {
h.logAndSendError(ctx, w, "empty bucket tag set", reqInfo, errors.GetAPIError(errors.ErrNoSuchTagSet))
return
}