Commit 89027a8
committed
fix(registry): fix create_bucket s3 compatability
The create_bucket script in the registry has some incompatibilities with
s3. In 1.12 deis is using the boto `lookup` function to determine
whether a bucket exists or not. The boto s3 connection is created using
an OrdinaryCallingFormat, for ceph compatibility. Unfortunately, S3
returns a 301 when lookup is called with OrdinaryCallingFormat, which
causes the lookup function to return None.
Prior to 1.12 the boto `get_all_buckets` function was used to determine
whether a bucket existed or not, which does not seem to have this
problem.
I've fixed it by updating the create_bucket script to not pass an
OrdinaryCallingFormat if the `/deis/registry/s3bucket` setting is
present, which fixes this issue. I've also omitted the
`is_secure=False` setting, which would cause boto to use s3 over http.
Additionally, if `/deis/store/gateway/accessKey` is not present (which
should be the case in a stateless setup) I'm using the s3 access keys
configured for the registry.
This fixes #4713 (and maybe #4710 and #4688). #4710 was labelled as a
documentation bug, but I'm not sure it is - seems like the stateless
registry should just read the s3 configuration from a single place
rather than relying on the `/deis/store/gateway/accessKey` config that
is usually set by the store-gateway.1 parent 0bb7b6e commit 89027a8
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
| 26 | + | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
| |||
0 commit comments