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

Commit

Permalink
Adding Support for ResourceName S3Buckets
Browse files Browse the repository at this point in the history
**Why:**

* Allows you to use the same `resourceName` for your s3buckets

**This change addresses the need by:**

* closes #52

Signed-off-by: Christopher Hein <me@christopherhein.com>
  • Loading branch information
christopherhein committed Aug 25, 2018
1 parent 6474c2f commit 0b174a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion examples/s3bucket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: S3Bucket
metadata:
name: chrishein-test-bucket-109
spec:
bucketName: chrishein-test-bucket-name-109
versioning: false
logging:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion models/s3bucket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
type: object
properties:
- key: bucketName
type: string
type: resourceName
description: |
BucketName is the name of the S3 Bucket to be created.
structKey: BucketName
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/s3bucket/cft.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (s *Cloudformation) CreateStack() (output *cloudformation.CreateStackOutput
resourceVersion := helpers.CreateParam("ResourceVersion", s.S3Bucket.ResourceVersion)
namespace := helpers.CreateParam("Namespace", s.S3Bucket.Namespace)
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(s.S3Bucket.Spec.BucketName))
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(s.S3Bucket.Name))
versioning := helpers.CreateParam("EnableVersioning", helpers.Stringify(s.S3Bucket.Spec.Versioning))
loggingenabled := helpers.CreateParam("EnableLogging", helpers.Stringify(s.S3Bucket.Spec.Logging.Enabled))
loggingprefix := helpers.CreateParam("LoggingPrefix", helpers.Stringify(s.S3Bucket.Spec.Logging.Prefix))
Expand Down Expand Up @@ -128,7 +128,7 @@ func (s *Cloudformation) UpdateStack(updated *awsV1alpha1.S3Bucket) (output *clo
resourceVersion := helpers.CreateParam("ResourceVersion", s.S3Bucket.ResourceVersion)
namespace := helpers.CreateParam("Namespace", s.S3Bucket.Namespace)
clusterName := helpers.CreateParam("ClusterName", s.config.ClusterName)
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(updated.Spec.BucketName))
bucketName := helpers.CreateParam("BucketName", helpers.Stringify(s.S3Bucket.Name))
versioning := helpers.CreateParam("EnableVersioning", helpers.Stringify(updated.Spec.Versioning))
loggingenabled := helpers.CreateParam("EnableLogging", helpers.Stringify(updated.Spec.Logging.Enabled))
loggingprefix := helpers.CreateParam("LoggingPrefix", helpers.Stringify(updated.Spec.Logging.Prefix))
Expand Down

0 comments on commit 0b174a4

Please sign in to comment.