File tree Expand file tree Collapse file tree
ansible/roles/iib_ci/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 right=$(grep "{{ image }}" "{{ iib_local_folder }}/mapping.txt" | cut -f2 -d=)
3434 right_base=$(echo $right | sed -e 's/:.*$//' -e 's/@.*$//')
3535 right_log=$(echo "${right_base}@${left_sha}" | sed -e 's/\//-/g')
36- if skopeo inspect --authfile "{{ pull_secrets_tempfolder.path }}/.dockerconfigjson" --no-tags docker://"{{ image }}" > /tmp/skopeo-"{{ image | regex_replace('/', '-') }}".log; then
36+ left_out=$(skopeo inspect --authfile "{{ pull_secrets_tempfolder.path }}/.dockerconfigjson" --no-tags docker://"{{ image }}" 2>&1)
37+ left_ret=$?
38+ if [ $left_ret -eq 0 ]; then
3739 echo "{{ image }}"
38- elif skopeo inspect --authfile "{{ pull_secrets_tempfolder.path }}/.dockerconfigjson" --no-tags docker://"${right_base}@${left_sha}" > "/tmp/skopeo-${right_log}.log"; then
39- echo "${right_base}@${left_sha}"
4040 else
41- echo "ERROR: both {{ image }} and echo ${right_base}@${left_sha} could not be found"
42- exit 1
41+ echo "${left_out}" > /tmp/skopeo-"{{ image | regex_replace('/', '-') }}".log
42+ right_out=$(skopeo inspect --authfile "{{ pull_secrets_tempfolder.path }}/.dockerconfigjson" --no-tags docker://"${right_base}@${left_sha}" 2>&1)
43+ right_ret=$?
44+ if [ $right_ret -eq 0 ]; then
45+ echo "${right_base}@${left_sha}"
46+ else # both left_ret and right_ret were != 0
47+ echo "${right_out}" > "/tmp/skopeo-${right_log}.log"
48+ echo "ERROR: both {{ image }} and echo ${right_base}@${left_sha} could not be found"
49+ echo "Printing both outputs:"
50+ echo "Left out: ${left_out}"
51+ echo "Right out: ${right_out}"
52+ exit 1
53+ fi
4354 fi
4455 register : all_existing_images
4556 with_items : " {{ all_images }}"
You can’t perform that action at this time.
0 commit comments