Skip to content
Snippets Groups Projects
Commit 13f225e6 authored by Timoses's avatar Timoses Committed by Kubernetes Prow Robot
Browse files

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.
parent 3f62492a
No related branches found
No related tags found
No related merge requests found
...@@ -15,12 +15,16 @@ ...@@ -15,12 +15,16 @@
failed_when: false failed_when: false
changed_when: false changed_when: false
check_mode: no check_mode: no
when: not download_always_pull when:
- not download_always_pull
- group_names | intersect(download.groups) | length
- set_fact: - set_fact:
pull_required: >- pull_required: >-
{%- if pull_args in docker_images.stdout.split(',') %}false{%- else -%}true{%- endif -%} {%- 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? - name: Does any host require container pull?
vars: vars:
...@@ -35,6 +39,7 @@ ...@@ -35,6 +39,7 @@
assert: assert:
that: "{{ download.repo }}:{{ download.tag }} in docker_images.stdout.split(',')" that: "{{ download.repo }}:{{ download.tag }} in docker_images.stdout.split(',')"
when: when:
- group_names | intersect(download.groups) | length
- not download_always_pull - not download_always_pull
- not pull_required - not pull_required
- pull_by_digest - pull_by_digest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment