diff --git a/pkg/cloud/services/s3/s3.go b/pkg/cloud/services/s3/s3.go index b485b43c95..0db725d85b 100644 --- a/pkg/cloud/services/s3/s3.go +++ b/pkg/cloud/services/s3/s3.go @@ -263,7 +263,7 @@ func (s *Service) tagBucket(bucketName string) error { Lifecycle: infrav1.ResourceLifecycleOwned, Name: nil, Role: aws.String("node"), - Additional: nil, + Additional: s.scope.AdditionalTags(), }) for key, value := range tags { diff --git a/pkg/cloud/services/s3/s3_test.go b/pkg/cloud/services/s3/s3_test.go index f3753b24ad..51234ea3be 100644 --- a/pkg/cloud/services/s3/s3_test.go +++ b/pkg/cloud/services/s3/s3_test.go @@ -80,6 +80,10 @@ func TestReconcileBucket(t *testing.T) { Bucket: aws.String(expectedBucketName), Tagging: &s3svc.Tagging{ TagSet: []*s3svc.Tag{ + { + Key: aws.String("additional"), + Value: aws.String("from-aws-cluster"), + }, { Key: aws.String("sigs.k8s.io/cluster-api-provider-aws/cluster/test-cluster"), Value: aws.String("owned"), @@ -776,6 +780,9 @@ func testService(t *testing.T, bucket *infrav1.S3Bucket) (*s3.Service, *mock_s3i AWSCluster: &infrav1.AWSCluster{ Spec: infrav1.AWSClusterSpec{ S3Bucket: bucket, + AdditionalTags: infrav1.Tags{ + "additional": "from-aws-cluster", + }, }, }, })