Skip to content

Commit 5c30356

Browse files
opcoder0auspham
authored andcommitted
[docker-ptf] Modify docker container pull setting (#21560)
Set pull to 'missing' to avoid pulling and overwriting the local image if there is a preloaded image present. This is used for testing PR built image which is preloaded in elastic test when PTF_MODIFIED is True. This mechanism is used to test PR built docker-ptf image. Signed-off-by: opcoder0 <[email protected]>
1 parent 10826ba commit 5c30356

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ansible/roles/vm_set/tasks/add_topo.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,12 @@
167167
docker_container:
168168
name: ptf_{{ vm_set_name }}
169169
image: "{{ docker_registry_host }}/{{ ptf_imagename }}:{{ ptf_imagetag }}"
170-
pull: yes
170+
# Set pull to 'missing' when ptf_modified is True (PR test with preloaded image)
171+
# to avoid pulling and overwriting the local image. For nightly tests where
172+
# ptf_modified is False/undefined, use 'always' to always pull the latest image.
173+
# The ptf_modified flag is passed from Azure Pipelines through Elastictest's
174+
# add_topo_params as "-e ptf_modified=True" when testing PR built docker-ptf images.
175+
pull: "{{ 'missing' if (ptf_modified | default(false) | bool) else 'always' }}"
171176
state: started
172177
restart: no
173178
network_mode: none

0 commit comments

Comments
 (0)