summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-02-14 15:00:23 -0800
committerJames E. Blair <jeblair@redhat.com>2019-02-14 15:03:11 -0800
commit2a3d69c8beda2599780dde5e96e1b1cb8f9a3872 (patch)
tree56e214f676935becf6befa471b32cb1efbbdc191
parent582e95db5382aa2a18d70db113ce93d495b688e8 (diff)
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
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Jeremy Stanley <fungi@yuggoth.org> Workflow+1: Jeremy Stanley <fungi@yuggoth.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 15 Feb 2019 01:08:07 +0000 Reviewed-on: https://review.openstack.org/637072 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/pull-from-intermediate-registry/tasks/main.yaml2
-rw-r--r--roles/push-to-intermediate-registry/tasks/push.yaml4
2 files changed, 3 insertions, 3 deletions
diff --git a/roles/pull-from-intermediate-registry/tasks/main.yaml b/roles/pull-from-intermediate-registry/tasks/main.yaml
index 090443b..b4fb5c4 100644
--- a/roles/pull-from-intermediate-registry/tasks/main.yaml
+++ b/roles/pull-from-intermediate-registry/tasks/main.yaml
@@ -6,5 +6,5 @@
6 {{ item.url }} 6 {{ item.url }}
7 docker://{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ item.metadata.repository }}:{{ item.metadata.tag }} 7 docker://{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ item.metadata.repository }}:{{ item.metadata.tag }}
8 when: "item.metadata.type | default('') == 'container_image'" 8 when: "item.metadata.type | default('') == 'container_image'"
9 loop: "{{ zuul.artifacts }}" 9 loop: "{{ zuul.artifacts | default([]) }}"
10 # no_log: true TODO(corvus): replace 10 # no_log: true TODO(corvus): replace
diff --git a/roles/push-to-intermediate-registry/tasks/push.yaml b/roles/push-to-intermediate-registry/tasks/push.yaml
index 8773a36..0d21d45 100644
--- a/roles/push-to-intermediate-registry/tasks/push.yaml
+++ b/roles/push-to-intermediate-registry/tasks/push.yaml
@@ -5,7 +5,7 @@
5 --dest-creds={{ intermediate_registry.username }}:{{ intermediate_registry.password }} 5 --dest-creds={{ intermediate_registry.username }}:{{ intermediate_registry.password }}
6 docker://{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ image.repository }}:{{ image_tag }} 6 docker://{{ buildset_registry.host }}:{{ buildset_registry.port }}/{{ image.repository }}:{{ image_tag }}
7 docker://{{ intermediate_registry.hostname }}:{{ intermediate_registry.port}}/{{ image.repository }}:{{ zuul.build }}_{{ image_tag}} 7 docker://{{ intermediate_registry.hostname }}:{{ intermediate_registry.port}}/{{ image.repository }}:{{ zuul.build }}_{{ image_tag}}
8 loop: "{{ image.tags }}" 8 loop: "{{ image.tags | default(['latest']) }}"
9 loop_control: 9 loop_control:
10 loop_var: image_tag 10 loop_var: image_tag
11 # no_log: true TODO(corvus) replace 11 # no_log: true TODO(corvus) replace
@@ -21,6 +21,6 @@
21 type: container_image 21 type: container_image
22 repository: "{{ image.repository }}" 22 repository: "{{ image.repository }}"
23 tag: "{{ image_tag }}" 23 tag: "{{ image_tag }}"
24 loop: "{{ image.tags }}" 24 loop: "{{ image.tags | default(['latest']) }}"
25 loop_control: 25 loop_control:
26 loop_var: image_tag 26 loop_var: image_tag