Skip to content

Commit c07cbd1

Browse files
author
Matthew Fisher
committed
chore(registry): bump confd to v0.8
1 parent a46078a commit c07cbd1

5 files changed

Lines changed: 41 additions & 47 deletions

File tree

registry/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdem
1010
&& chmod +x /usr/local/bin/etcdctl
1111

1212
# install confd
13-
RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json \
13+
RUN curl -sSL -o /usr/local/bin/confd https://github.com/kelseyhightower/confd/releases/download/v0.8.0/confd-0.8.0-linux-amd64 \
1414
&& chmod +x /usr/local/bin/confd
1515

1616
ENV DOCKER_REGISTRY_CONFIG /docker-registry/config/config.yml
@@ -28,4 +28,3 @@ RUN DOCKER_BUILD=true /app/build.sh
2828
ADD . /app
2929

3030
ENV DEIS_RELEASE 1.5.0-dev
31-

registry/bin/boot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ etcd_set_default protocol http
4545
etcd_set_default bucketName ${BUCKET_NAME}
4646

4747
# wait for confd to run once and install initial templates
48-
until confd -onetime -node $ETCD -config-file /app/confd.toml; do
48+
until confd -onetime -node $ETCD --confdir /app --interval 5 --quiet; do
4949
echo "registry: waiting for confd to write initial templates..."
5050
sleep $(($ETCD_TTL/2)) # sleep for half the TTL
5151
done
@@ -67,7 +67,7 @@ function on_exit() {
6767
trap on_exit INT TERM
6868

6969
# spawn confd in the background to update services based on etcd changes
70-
confd -node $ETCD -config-file /app/confd.toml &
70+
confd -node $ETCD --confdir /app --interval 5 --quiet &
7171
CONFD_PID=$!
7272

7373
echo deis-registry running...

registry/confd.toml

Lines changed: 0 additions & 5 deletions
This file was deleted.

registry/templates/config.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,30 @@ common: &common
2626
tags_cache_ttl: _env:MIRROR_TAGS_CACHE_TTL:172800 # seconds
2727

2828
cache:
29-
host: {{ or (.deis_cache_host) "" }}
30-
port: {{ or (.deis_cache_port) "" }}
29+
host: {{ if exists "/deis/cache/host" }}{{ getv "/deis/cache/host" }}{{ else }}""{{ end }}
30+
port: {{ if exists "/deis/cache/port" }}{{ getv "/deis/cache/port" }}{{ else }}""{{ end }}
3131
password: _env:CACHE_REDIS_PASSWORD
3232
db: 1
3333

3434
# Enabling LRU cache for small files
3535
# This speeds up read/write on small files
3636
# when using a remote storage backend (like S3).
3737
cache_lru:
38-
host: {{ or (.deis_cache_host) "" }}
39-
port: {{ or (.deis_cache_port) "" }}
38+
host: {{ if exists "/deis/cache/host" }}{{ getv "/deis/cache/host" }}{{ else }}""{{ end }}
39+
port: {{ if exists "/deis/cache/port" }}{{ getv "/deis/cache/port" }}{{ else }}""{{ end }}
4040
password: _env:CACHE_LRU_REDIS_PASSWORD
4141
db: 2
4242

4343
# Enabling these options makes the Registry send an email on each code Exception
44-
{{ if .deis_registry_smtpHost }}
44+
{{ if exists "/deis/registry/smtpHost" }}
4545
email_exceptions:
46-
smtp_host: {{ or (.deis_registry_smtpHost) "" }}
47-
smtp_port: {{ or (.deis_registry_smtpPort) "25" }}
48-
smtp_login: {{ or (.deis_registry_smtpLogin) "" }}
49-
smtp_password: {{ or (.deis_registry_smtpPassword) "" }}
50-
smtp_secure: bool({{ or (.deis_registry_smtpSecure) "false" }})
51-
from_addr: {{ or (.deis_registry_smtpFrom) "docker-registry@localdomain.local" }}
52-
to_addr: {{ or (.deis_registry_smtpTo) "noise+dockerregistry@localdomain.local" }}
46+
smtp_host: {{ if exists "/deis/registry/smtpHost" }}{{ getv "/deis/registry/smtpHost" }}{{ else }}""{{ end }}
47+
smtp_port: {{ if exists "/deis/registry/smtpPort" }}{{ getv "/deis/registry/smtpPort" }}{{ else }}"25"{{ end }}
48+
smtp_login: {{ if exists "/deis/registry/smtpLogin" }}{{ getv "/deis/registry/smtpLogin" }}{{ else }}""{{ end }}
49+
smtp_password: {{ if exists "/deis/registry/smtpPassword" }}{{ getv "/deis/registry/smtpPassword" }}{{ else }}""{{ end }}
50+
smtp_secure: bool({{ if exists "/deis/registry/smtpSecure" }}{{ getv "/deis/registry/smtpSecure" }}{{ else }}"false"{{ end }})
51+
from_addr: {{ if exists "/deis/registry/smtpFrom" }}{{ getv "/deis/registry/smtpFrom" }}{{ else }}"docker-registry@localdomain.local"{{ end }}
52+
to_addr: {{ if exists "/deis/registry/smtpTo" }}{{ getv "/deis/registry/smtpTo" }}{{ else }}"noise+dockerregistry@localdomain.local"{{ end }}
5353
{{ end }}
5454

5555
# Enable bugsnag (set the API key)
@@ -78,30 +78,30 @@ local: &local
7878
s3: &s3
7979
<<: *common
8080
storage: s3
81-
s3_region: {{ or (.deis_registry_s3region) "" }}
82-
s3_bucket: {{ or (.deis_registry_s3bucket) "" }}
83-
boto_bucket: {{ or (.deis_registry_s3bucket) "" }}
84-
storage_path: {{ or (.deis_registry_s3path) "/registry" }}
85-
s3_encrypt: bool({{ or (.deis_registry_s3encrypt) "true" }})
86-
s3_secure: bool({{ or (.deis_registry_s3secure) "true" }})
87-
s3_access_key: {{ or (.deis_registry_s3accessKey) "" }}
88-
s3_secret_key: {{ or (.deis_registry_s3secretKey) "" }}
81+
s3_region: {{ if exists "/deis/registry/s3region" }}{{ getv "/deis/registry/s3region" }}{{ else }}""{{ end }}
82+
s3_bucket: {{ if exists "/deis/registry/s3bucket" }}{{ getv "/deis/registry/s3bucket" }}{{ else }}""{{ end }}
83+
boto_bucket: {{ if exists "/deis/registry/s3bucket" }}{{ getv "/deis/registry/s3bucket" }}{{ else }}""{{ end }}
84+
storage_path: {{ if exists "/deis/registry/s3path" }}{{ getv "/deis/registry/s3path" }}{{ else }}"/registry"{{ end }}
85+
s3_encrypt: bool({{ if exists "/deis/registry/s3encrypt" }}{{ getv "/deis/registry/s3encrypt" }}{{ else }}"true"{{ end }})
86+
s3_secure: bool({{ if exists "/deis/registry/s3secure" }}{{ getv "/deis/registry/s3secure" }}{{ else }}"true"{{ end }})
87+
s3_access_key: {{ if exists "/deis/registry/s3accessKey" }}{{ getv "/deis/registry/s3accessKey" }}{{ else }}""{{ end }}
88+
s3_secret_key: {{ if exists "/deis/registry/s3secretKey" }}{{ getv "/deis/registry/s3secretKey" }}{{ else }}""{{ end }}
8989

9090
# Ceph Object Gateway Configuration
9191
# See http://ceph.com/docs/master/radosgw/ for details on installing this service.
9292
ceph-s3: &ceph-s3
9393
<<: *common
9494
storage: s3
9595
s3_region: ~
96-
s3_bucket: {{ .deis_registry_bucketName }}
96+
s3_bucket: {{ getv "/deis/registry/bucketName" }}
9797
s3_encrypt: false
9898
s3_secure: false
9999
storage_path: /registry
100-
s3_access_key: {{ .deis_store_gateway_accessKey }}
101-
s3_secret_key: {{ .deis_store_gateway_secretKey }}
102-
boto_bucket: {{ .deis_registry_bucketName }}
103-
boto_host: {{ .deis_store_gateway_host }}
104-
boto_port: {{ .deis_store_gateway_port }}
100+
s3_access_key: {{ getv "/deis/store/gateway/accessKey" }}
101+
s3_secret_key: {{ getv "/deis/store/gateway/secretKey" }}
102+
boto_bucket: {{ getv "/deis/registry/bucketName" }}
103+
boto_host: {{ getv "/deis/store/gateway/host" }}
104+
boto_port: {{ getv "/deis/store/gateway/port" }}
105105
boto_debug: 0
106106
boto_calling_format: boto.s3.connection.OrdinaryCallingFormat
107107

@@ -131,12 +131,12 @@ swift: &swift
131131
storage: swift
132132
storage_path: _env:STORAGE_PATH:/registry
133133
# keystone authorization
134-
swift_authurl: {{ or (.deis_registry_swiftAuthURL) "" }}
135-
swift_container: {{ or (.deis_registry_swiftContainer) "" }}
136-
swift_user: {{ or (.deis_registry_swiftUser) "" }}
137-
swift_password: {{ or (.deis_registry_swiftPassword) "" }}
138-
swift_tenant_name: {{ or (.deis_registry_swiftTenantName) "" }}
139-
swift_region_name: {{ or (.deis_registry_swiftRegionName) "" }}
134+
swift_authurl: {{ if exists "/deis/registry/swiftAuthURL" }}{{ getv "/deis/registry/swiftAuthURL" }}{{ else }}""{{ end }}
135+
swift_container: {{ if exists "/deis/registry/swiftContainer" }}{{ getv "/deis/registry/swiftContainer" }}{{ else }}""{{ end }}
136+
swift_user: {{ if exists "/deis/registry/swiftUser" }}{{ getv "/deis/registry/swiftUser" }}{{ else }}""{{ end }}
137+
swift_password: {{ if exists "/deis/registry/swiftPassword" }}{{ getv "/deis/registry/swiftPassword" }}{{ else }}""{{ end }}
138+
swift_tenant_name: {{ if exists "/deis/registry/swiftTenantName" }}{{ getv "/deis/registry/swiftTenantName" }}{{ else }}""{{ end }}
139+
swift_region_name: {{ if exists "/deis/registry/swiftRegionName" }}{{ getv "/deis/registry/swiftRegionName" }}{{ else }}""{{ end }}
140140

141141
# This flavor stores the images in Glance (to integrate with openstack)
142142
# See also: https://github.com/dotcloud/openstack-docker
@@ -194,7 +194,7 @@ prod:
194194

195195
# Flavor used by deis
196196
deis:
197-
{{ if .deis_registry_s3accessKey }}<<: *s3
198-
{{ else if .deis_registry_swiftAuthURL }} <<: *openstack-swift
197+
{{ if exists "/deis/registry/s3accessKey" }}<<: *s3
198+
{{ else if exists "/deis/registry/swiftAuthURL" }} <<: *openstack-swift
199199
{{ else }} <<: *ceph-s3
200200
{{ end }}

registry/templates/create_bucket

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import boto
33
import sys
44
from boto.s3.connection import OrdinaryCallingFormat
55

6-
conn = boto.connect_s3(aws_access_key_id='{{ .deis_store_gateway_accessKey }}',
7-
aws_secret_access_key='{{ .deis_store_gateway_secretKey }}',
8-
host='{{ .deis_store_gateway_host }}',
9-
port={{ .deis_store_gateway_port }},
6+
conn = boto.connect_s3(aws_access_key_id='{{ getv "/deis/store/gateway/accessKey" }}',
7+
aws_secret_access_key='{{ getv "/deis/store/gateway/secretKey" }}',
8+
host='{{ getv "/deis/store/gateway/host" }}',
9+
port={{ getv "/deis/store/gateway/port" }},
1010
is_secure=False,
1111
calling_format=OrdinaryCallingFormat(),
1212
)

0 commit comments

Comments
 (0)