Browse Source

Only pull images for destined host groups (#4735)

Without this, pulls are considered for all
hosts groups, even if not targetted by the downloads
`groups` list. Hence, a download/sync is triggered
even though the host does not require the image.
pull/4753/merge
Timoses 5 years ago
committed by Kubernetes Prow Robot
parent
commit
13f225e6ae
1 changed files with 7 additions and 2 deletions
  1. 9
      roles/download/tasks/set_docker_image_facts.yml

9
roles/download/tasks/set_docker_image_facts.yml

@ -15,12 +15,16 @@
failed_when: false
changed_when: false
check_mode: no
when: not download_always_pull
when:
- not download_always_pull
- group_names | intersect(download.groups) | length
- set_fact:
pull_required: >-
{%- if pull_args in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%}
when: not download_always_pull
when:
- not download_always_pull
- group_names | intersect(download.groups) | length
- name: Does any host require container pull?
vars:
@ -35,6 +39,7 @@
assert:
that: "{{ download.repo }}:{{ download.tag }} in docker_images.stdout.split(',')"
when:
- group_names | intersect(download.groups) | length
- not download_always_pull
- not pull_required
- pull_by_digest

Loading…
Cancel
Save