From 5aafbac11dd1e345dca8836df802b33f6518a3c3 Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Fri, 6 Jan 2017 11:14:51 -0800 Subject: [PATCH] fix(create-bucket): set BUCKET_NAME for swift --- main.go | 1 + rootfs/bin/create-bucket | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index f380eaa..6158b9b 100644 --- a/main.go +++ b/main.go @@ -136,6 +136,7 @@ func main() { log.Fatal(err) } else { os.Setenv("REGISTRY_STORAGE_SWIFT_CONTAINER", string(container)) + os.Setenv("BUCKET_NAME", string(container)) } if authVersion, err := ioutil.ReadFile("/var/run/secrets/deis/registry/creds/authversion"); err != nil { diff --git a/rootfs/bin/create-bucket b/rootfs/bin/create-bucket index 92c0afb..9a3b891 100755 --- a/rootfs/bin/create-bucket +++ b/rootfs/bin/create-bucket @@ -53,7 +53,7 @@ elif os.getenv('REGISTRY_STORAGE') == "swift": tenant_name=os.getenv('REGISTRY_STORAGE_SWIFT_TENANT') ) # swift also does not throw exception if container already exists. - conn.put_container(os.getenv('BUCKET_NAME')) + conn.put_container(bucket_name) elif os.getenv('REGISTRY_STORAGE') == "s3" and os.getenv('REGISTRY_STORAGE_S3_BACKEND') == 'minio': botoconfig.add_section('s3')