Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 0b174a4

Browse files
Adding Support for ResourceName S3Buckets
**Why:** * Allows you to use the same `resourceName` for your s3buckets **This change addresses the need by:** * closes #52 Signed-off-by: Christopher Hein <[email protected]>
1 parent 6474c2f commit 0b174a4

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

examples/s3bucket.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ kind: S3Bucket
33
metadata:
44
name: chrishein-test-bucket-109
55
spec:
6-
bucketName: chrishein-test-bucket-name-109
76
versioning: false
87
logging:
98
enabled: false

models/s3bucket.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
type: object
2020
properties:
2121
- key: bucketName
22-
type: string
22+
type: resourceName
2323
description: |
2424
BucketName is the name of the S3 Bucket to be created.
2525
structKey: BucketName

pkg/operator/s3bucket/cft.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (s *Cloudformation) CreateStack() (output *cloudformation.CreateStackOutput
7575
resourceVersion := helpers.CreateParam("ResourceVersion", s.S3Bucket.ResourceVersion)
7676
namespace := helpers.CreateParam("Namespace", s.S3Bucket.Namespace)
7777
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
78-
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(s.S3Bucket.Spec.BucketName))
78+
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(s.S3Bucket.Name))
7979
versioning := helpers.CreateParam("EnableVersioning", helpers.Stringify(s.S3Bucket.Spec.Versioning))
8080
loggingenabled := helpers.CreateParam("EnableLogging", helpers.Stringify(s.S3Bucket.Spec.Logging.Enabled))
8181
loggingprefix := helpers.CreateParam("LoggingPrefix", helpers.Stringify(s.S3Bucket.Spec.Logging.Prefix))
@@ -128,7 +128,7 @@ func (s *Cloudformation) UpdateStack(updated *awsV1alpha1.S3Bucket) (output *clo
128128
resourceVersion := helpers.CreateParam("ResourceVersion", s.S3Bucket.ResourceVersion)
129129
namespace := helpers.CreateParam("Namespace", s.S3Bucket.Namespace)
130130
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
131-
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(updated.Spec.BucketName))
131+
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(s.S3Bucket.Name))
132132
versioning := helpers.CreateParam("EnableVersioning", helpers.Stringify(updated.Spec.Versioning))
133133
loggingenabled := helpers.CreateParam("EnableLogging", helpers.Stringify(updated.Spec.Logging.Enabled))
134134
loggingprefix := helpers.CreateParam("LoggingPrefix", helpers.Stringify(updated.Spec.Logging.Prefix))

0 commit comments

Comments
 (0)