deis / postgres

A PostgreSQL database used by Deis Workflow.
https://deis.com
MIT License
36 stars 22 forks source link

fix(postgres) block invalid S3 bucket name #181

Closed greglearns closed 7 years ago

greglearns commented 7 years ago

Using a period in BUCKET_NAME causes helm install -f values.yaml deis/workflow --namespace=deis to fail

RELATED ISSUES

https://github.com/deis/workflow/issues/700 https://github.com/deis/workflow/pull/701 (documentation fix)

Note: this bug also exists for https://github.com/deis/registry/blob/master/rootfs/bin/create-bucket#L27

REPRODUCING THE BUG

Using a period in BUCKET_NAME causes helm install -f values.yaml deis/workflow --namespace=deis to fail with this error:

ssl.CertificateError: hostname 'deis.subdomain.domain.com-registry.s3-us-west-2.amazonaws.com' doesn't match either of 's3-us-west-2.amazonaws.com', '*.s3-us-west-2.amazonaws.com', 's3.us-west-2.amazonaws.com', '*.s3.us-west-2.amazonaws.com', 's3.dualstack.us-west-2.amazonaws.com', '*.s3.dualstack.us-west-2.amazonaws.com', '*.s3.amazonaws.com'
2017/01/14 07:20:04 Error creating the registry bucket: exit status 1

A POSSIBLE FIX

Not sure how to create a test for this (I just started using Deis 4 days ago), but, a hacky test is this:

echo "a.bad.thing-mixed-with-a-good-thing" | sed "s/[.]/-/g"
# a-bad-thing-mixed-with-a-good-thing
deis-admin commented 7 years ago

Thanks for the contribution! Please ensure your commits follow our style guide. This code will be tested once a Deis maintainer reviews it.

deis-bot commented 7 years ago

@bacongobbler and @paulczar are potential reviewers of this pull request based on my analysis of git blame information. Thanks @greglearns!

greglearns commented 7 years ago

... oops, the commit name should have been something like "fix(postgres): block invalid S3 bucket name" according to http://docs.deis.io/en/latest/contributing/standards/#commit-style-guide

greglearns commented 7 years ago

Closing: will resubmit with git commit message fixes.

greglearns commented 7 years ago

New PR: https://github.com/deis/postgres/pull/182