Fix docker registry bugs
diff --git a/docker/files/registry.yml b/docker/files/registry.yml
index 734e75a..c762e06 100644
--- a/docker/files/registry.yml
+++ b/docker/files/registry.yml
@@ -1,8 +1,8 @@
{%- from "docker/map.jinja" import registry with context -%}
version: 0.1
log:
- level: {{ registry.log.level|default('info') }}
- formatter: {{ registry.log.formatter|default('text') }}
+ level: {{ registry.get('log', {}).level|default('info') }}
+ formatter: {{ registry.get('log', {}).formatter|default('text') }}
fields:
service: registry
storage:
@@ -12,7 +12,7 @@
filesystem:
rootdirectory: {{ registry.storage.root }}
{%- endif %}
-{%- if registry.cache.engine == redis %}
+{%- if registry.cache.engine == "redis" %}
redis:
addr: {{ registry.cache.get('host', 'localhost') }}:{{ registry.cache.get('port', 6379) }}
{%- if registry.cache.password is defined %}
diff --git a/docker/map.jinja b/docker/map.jinja
index fc83e8b..f1e875b 100644
--- a/docker/map.jinja
+++ b/docker/map.jinja
@@ -46,7 +46,7 @@
}, grain='os', merge=salt['pillar.get']('docker:compose')) %}
{% set registry = salt['grains.filter_by']({
- 'Debian': {
+ 'default': {
'pkgs': ['docker-registry'],
'service': 'docker-registry',
'cache': {
diff --git a/docker/registry.sls b/docker/registry.sls
index 3611f6a..0fdcd7e 100644
--- a/docker/registry.sls
+++ b/docker/registry.sls
@@ -15,6 +15,7 @@
docker_registry_config:
file.managed:
+ - name: /etc/docker/registry/config.yml
- source: salt://docker/files/registry.yml
- template: jinja
- require: