Fix undefined attrs in registry push/pull roles

The attribute zuul.artifacts is only present if there are artifacts.
Use the empty list as default.

The default for image.tags should be 'latest' to match the rest
of the docker roles.

Change-Id: Iff6863043e3a0311cb1c8c2ef4cd3d37ff79cce5
This commit is contained in:
James E. Blair 2019-02-14 15:00:23 -08:00
parent 582e95db53
commit 2a3d69c8be
2 changed files with 3 additions and 3 deletions

View File

@ -6,5 +6,5 @@
{{ item.url }}
docker://{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ item.metadata.repository }}:{{ item.metadata.tag }}
when: "item.metadata.type | default('') == 'container_image'"
loop: "{{ zuul.artifacts }}"
loop: "{{ zuul.artifacts | default([]) }}"
# no_log: true TODO(corvus): replace

View File

@ -5,7 +5,7 @@
--dest-creds={{ intermediate_registry.username }}:{{ intermediate_registry.password }}
docker://{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ image.repository }}:{{ image_tag }}
docker://{{ intermediate_registry.hostname }}:{{ intermediate_registry.port}}/{{ image.repository }}:{{ zuul.build }}_{{ image_tag}}
loop: "{{ image.tags }}"
loop: "{{ image.tags | default(['latest']) }}"
loop_control:
loop_var: image_tag
# no_log: true TODO(corvus) replace
@ -21,6 +21,6 @@
type: container_image
repository: "{{ image.repository }}"
tag: "{{ image_tag }}"
loop: "{{ image.tags }}"
loop: "{{ image.tags | default(['latest']) }}"
loop_control:
loop_var: image_tag