Do not timeout podman/docker pull if timeout value is '0'

If user sets "docker_pull_timeout: '0'" then do not use the
timeout command when running podman/docker pull. Also, use
"timeout -s KILL"; without KILL, podman on RHEL8 beta does
not timeout and deployment can hang.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1670625
Signed-off-by: John Fulton <fulton@redhat.com>
pull/3559/head
John Fulton 2019-01-30 15:06:55 -05:00 committed by mergify[bot]
parent fe1528adb4
commit cba9b23363
1 changed files with 7 additions and 1 deletions

View File

@ -176,8 +176,14 @@
- nfs_group_name in group_names - nfs_group_name in group_names
- ceph_nfs_container_inspect_before_pull.get('rc') == 0 - ceph_nfs_container_inspect_before_pull.get('rc') == 0
- name: set_fact timeout_command
set_fact:
timeout_command: "{{ 'timeout -s KILL ' ~ docker_pull_timeout if (docker_pull_timeout != '0') else '' }}"
when:
- (ceph_docker_dev_image is undefined or not ceph_docker_dev_image)
- name: "pulling {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image" - name: "pulling {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image"
command: "timeout {{ docker_pull_timeout }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" command: "{{ timeout_command }} {{ container_binary }} pull {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
changed_when: false changed_when: false
register: docker_image register: docker_image
until: docker_image.rc == 0 until: docker_image.rc == 0