Skip to content

Commit 515e394

Browse files
Handle podman auth discovery for ppc64le vms
Signed-off-by: mdafsanhossain <Mdafsan.Hossain@ibm.com>
1 parent fd617f9 commit 515e394

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

ansible/roles/run-test-target/tasks/test-docker.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@
5454
become: "{{ runtime_as_root }}"
5555
shell:
5656
cmd: |
57-
if [[ -f "/run/containers/0/auth.json" ]]; then
5857
mkdir -p ~/.docker/
59-
cp "/run/containers/0/auth.json" ~/.docker/config.json
60-
fi
58+
if [[ -f "${XDG_RUNTIME_DIR:-}/containers/auth.json" ]]; then
59+
AUTH_FILE="${XDG_RUNTIME_DIR:-}/containers/auth.json"
60+
elif [[ -f "/run/containers/0/auth.json" ]]; then
61+
AUTH_FILE="/run/containers/0/auth.json"
62+
else
63+
echo >&2 "No valid auth.json file found"
64+
exit 1
65+
fi
66+
cp "${AUTH_FILE}" ~/.docker/config.json
6167
creates: ~/.docker/config.json
6268
when: runtime_command == "podman"
6369

0 commit comments

Comments
 (0)