Skip to content

Commit

Permalink
Merge pull request #30 from stefanberger/pull_secret
Browse files Browse the repository at this point in the history
tests: Allow passing pull credentials using IMAGE_PULL_CREDS
  • Loading branch information
stefanberger committed Jan 6, 2021
2 parents 36840ad + 13165f5 commit c591bad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions script/tests/test_encryption.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,14 @@ failExit() {
}

pullImages() {
if [ -z "$IMAGE_PULL_CREDS" ]; then
echo "Note: Image pull credentials can be passed with env. variable IMAGE_PULL_CREDS=<username>:<password>"
fi
$CTR images rm --sync ${ALPINE_ENC} ${ALPINE_DEC} ${NGINX_ENC} ${NGINX_DEC} &>/dev/null
$CTR images pull --all-platforms ${ALPINE} &>/dev/null
$CTR images pull ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} --all-platforms ${ALPINE} &>/dev/null
failExit $? "Image pull failed on ${ALPINE}"

$CTR images pull --platform linux/amd64 ${NGINX} &>/dev/null
$CTR images pull ${IMAGE_PULL_CREDS:+--user ${IMAGE_PULL_CREDS}} --platform linux/amd64 ${NGINX} &>/dev/null
failExit $? "Image pull failed on ${NGINX}"

LAYER_INFO_ALPINE="$($CTR images layerinfo ${ALPINE})"
Expand Down

0 comments on commit c591bad

Please sign in to comment.