Skip to content

Commit

Permalink
Use AdditionalTags for S3 buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiDog committed Nov 9, 2023
1 parent 8a2a0ad commit 5bff304
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cloud/services/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions pkg/cloud/services/s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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",
},
},
},
})
Expand Down

0 comments on commit 5bff304

Please sign in to comment.