Skip to content

Commit b3b4389

Browse files
committed
Add changelog entry
1 parent 7f0d878 commit b3b4389

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

.changelog/1.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resource/aws_s3_bucket_lifecycle_configuration: Normalize empty prefix values when reading lifecycle configurations from S3-compatible services
3+
```

internal/service/s3/bucket_lifecycle_configuration_test.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5349,44 +5349,3 @@ func TestNormalizeEmptyPrefix(t *testing.T) {
53495349
})
53505350
}
53515351
}
5352-
5353-
func TestExpandNormalizeSymmetry(t *testing.T) {
5354-
t.Parallel()
5355-
5356-
testCases := []struct {
5357-
name string
5358-
configValue string
5359-
afterExpand *string
5360-
afterNormalize *string
5361-
}{
5362-
{
5363-
name: "empty string config",
5364-
configValue: "",
5365-
afterExpand: nil, // fwflex.EmptyStringAsNull converts "" to nil
5366-
afterNormalize: nil, // normalization keeps nil as nil
5367-
},
5368-
{
5369-
name: "non-empty config",
5370-
configValue: "logs/",
5371-
afterExpand: aws.String("logs/"),
5372-
afterNormalize: aws.String("logs/"),
5373-
},
5374-
}
5375-
5376-
for _, tc := range testCases {
5377-
t.Run(tc.name, func(t *testing.T) {
5378-
// This test proves the expand->API->normalize cycle is symmetric
5379-
// 1. Config "" -> expand -> nil (sent to API)
5380-
// 2. API returns "" (Ceph) or nil (AWS)
5381-
// 3. normalize -> nil (consistent internal representation)
5382-
5383-
if tc.afterExpand == nil && tc.afterNormalize != nil {
5384-
t.Errorf("Symmetry broken: expand returned nil but normalize expects %v", *tc.afterNormalize)
5385-
} else if tc.afterExpand != nil && tc.afterNormalize == nil {
5386-
t.Errorf("Symmetry broken: expand returned %v but normalize expects nil", *tc.afterExpand)
5387-
} else if tc.afterExpand != nil && tc.afterNormalize != nil && *tc.afterExpand != *tc.afterNormalize {
5388-
t.Errorf("Symmetry broken: expand returned %v but normalize expects %v", *tc.afterExpand, *tc.afterNormalize)
5389-
}
5390-
})
5391-
}
5392-
}

0 commit comments

Comments
 (0)