function oci_push_to_registry : logout from registry after upload

This commit is contained in:
Gitouche 2023-02-19 12:04:14 +01:00
parent fd49d873b7
commit 03c62b8aaa

View file

@ -314,6 +314,7 @@ oci_push_to_registry () {
podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${1%%/*} && podman login --username ${CONTAINER_REPO_USER} --password ${CONTAINER_REPO_PASSWORD} ${1%%/*} &&
# Try x times because of unexplained error 500 # Try x times because of unexplained error 500
for i in $(seq 1 3); do podman push ${1} && s=0 && break || s=$? && sleep 1; done; (exit $s) && for i in $(seq 1 3); do podman push ${1} && s=0 && break || s=$? && sleep 1; done; (exit $s) &&
podman logout ${1%%/*} &&
podman image rm ${1} && podman image rm ${1} &&
podman pull ${1} podman pull ${1}
else else