Skip to content

Commit 644a479

Browse files
authored
Merge pull request #4625 from AndiDog/s3-bucket-additional-tags
Use `AdditionalTags` for S3 buckets
2 parents 8a2a0ad + 5bff304 commit 644a479

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/cloud/services/s3/s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func (s *Service) tagBucket(bucketName string) error {
263263
Lifecycle: infrav1.ResourceLifecycleOwned,
264264
Name: nil,
265265
Role: aws.String("node"),
266-
Additional: nil,
266+
Additional: s.scope.AdditionalTags(),
267267
})
268268

269269
for key, value := range tags {

pkg/cloud/services/s3/s3_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ func TestReconcileBucket(t *testing.T) {
8080
Bucket: aws.String(expectedBucketName),
8181
Tagging: &s3svc.Tagging{
8282
TagSet: []*s3svc.Tag{
83+
{
84+
Key: aws.String("additional"),
85+
Value: aws.String("from-aws-cluster"),
86+
},
8387
{
8488
Key: aws.String("sigs.k8s.io/cluster-api-provider-aws/cluster/test-cluster"),
8589
Value: aws.String("owned"),
@@ -776,6 +780,9 @@ func testService(t *testing.T, bucket *infrav1.S3Bucket) (*s3.Service, *mock_s3i
776780
AWSCluster: &infrav1.AWSCluster{
777781
Spec: infrav1.AWSClusterSpec{
778782
S3Bucket: bucket,
783+
AdditionalTags: infrav1.Tags{
784+
"additional": "from-aws-cluster",
785+
},
779786
},
780787
},
781788
})

0 commit comments

Comments
 (0)