fix(s3): return NoSuchTagSet from GetBucketTagging on untagged buckets (#4585)

GetBucketTagging returned 200 with an empty TagSet when a bucket had no tags, including after DeleteBucketTagging. AWS returns the NoSuchTagSet error instead. S3 Control ListTagsForResource still reports an empty list.
This commit is contained in:
Niels Kootstra authored and GitHub committed 2026-09-28 16:25:06 -04:00
1 parent fbbbf244af
commit 93ec5967fe
4 files changed
+54 -6

No files matched your search

@@ -257,10 +257,10 @@ class S3Test {
void deleteBucketTagging() {
s3.deleteBucketTagging(DeleteBucketTaggingRequest.builder().bucket(BUCKET).build());
GetBucketTaggingResponse response = s3.getBucketTagging(
GetBucketTaggingRequest.builder().bucket(BUCKET).build());
assertThat(response.tagSet()).isEmpty();
assertThatThrownBy(() -> s3.getBucketTagging(
GetBucketTaggingRequest.builder().bucket(BUCKET).build()))
.isInstanceOfSatisfying(S3Exception.class,
e -> assertThat(e.awsErrorDetails().errorCode()).isEqualTo("NoSuchTagSet"));
}
@Test