Skip to content

Commit

Permalink
test-lib: only pull images when allowed by the called
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubatrh committed Sep 21, 2018
1 parent 8217146 commit da51a6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ ct_s2i_usage()
# Argument: APP_PATH - local path to the app sources to be used in the test
# Argument: SRC_IMAGE - image to be used as a base for the s2i build
# Argument: DST_IMAGE - image name to be used during the tagging of the s2i build result
# Argument: S2I_ARGS - Additional list of source-to-image arguments, currently unused.
# Argument: S2I_ARGS - Additional list of source-to-image arguments, currently only used to check for pull-policy=never.
ct_s2i_build_as_df()
{
local app_path=$1; shift
Expand All @@ -460,7 +460,7 @@ ct_s2i_build_as_df()
df_name=$(mktemp -p "$tmpdir" Dockerfile.XXXX)
pushd "$tmpdir"
# Check if the image is available locally and try to pull it if it is not
docker images "$src_image" &>/dev/null || docker pull "$src_image"
docker images "$src_image" &>/dev/null || echo "$s2i_args" | grep -q "pull-policy=never" || docker pull "$src_image"
user_id=$(docker inspect -f "{{.ContainerConfig.User}}" "$src_image")
# Strip file:// from APP_PATH and copy its contents into current context
mkdir -p "$local_app"
Expand Down

0 comments on commit da51a6a

Please sign in to comment.