From 58f922aac36bfae10d258a416d149138cc1fdd1f Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Wed, 20 Jan 2021 11:17:10 -0500 Subject: [PATCH] Skip image pull if so-tcpreplay image already exists and is current --- salt/common/tools/sbin/so-tcpreplay | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/salt/common/tools/sbin/so-tcpreplay b/salt/common/tools/sbin/so-tcpreplay index 22722ac9b..b5dbb4155 100755 --- a/salt/common/tools/sbin/so-tcpreplay +++ b/salt/common/tools/sbin/so-tcpreplay @@ -48,9 +48,15 @@ if ! docker ps | grep -q so-tcpreplay; then echo if is_manager_node; then - TRUSTED_CONTAINERS=("so-tcpreplay") - mkdir -p /opt/so/log/tcpreplay - update_docker_containers "tcpreplay" "" "" "/opt/so/log/tcpreplay/init.log" + set_version + if ! docker images | grep so-tcpreplay | grep ":5000" | grep -q $VERSION ; then + echo "Pulling so-tcpreplay image" + TRUSTED_CONTAINERS=("so-tcpreplay") + mkdir -p /opt/so/log/tcpreplay + update_docker_containers "tcpreplay" "" "" "/opt/so/log/tcpreplay/init.log" + else + echo "so-tcpreplay image exists." + fi fi if is_sensor_node; then if ! is_manager_node; then