Add support for podman push --retry --retry-delay

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2024-02-21 06:11:50 -05:00
parent e5ee0bb5f3
commit c3c0c4ab96
13 changed files with 138 additions and 9 deletions

View File

@@ -327,7 +327,7 @@ function _test_skopeo_credential_sharing() {
}
@test "podman images with retry" {
@test "podman pull images with retry" {
run_podman pull -q --retry 4 --retry-delay "10s" $IMAGE
run_podman 125 pull -q --retry 4 --retry-delay "bogus" $IMAGE
is "$output" 'Error: time: invalid duration "bogus"' "bad retry-delay"
@@ -367,6 +367,30 @@ function _test_skopeo_credential_sharing() {
run_podman rmi $image1
}
@test "podman containers.conf retry" {
skip_if_remote "containers.conf settings not set for remote connections"
run_podman pull --help
assert "$output" =~ "--retry .*performing pull \(default 3\)"
run_podman push --help
assert "$output" =~ "--retry .*performing push \(default 3\)"
containersConf=$PODMAN_TMPDIR/containers.conf
cat >$containersConf <<EOF
[engine]
retry=10
retry_delay="5s"
EOF
CONTAINERS_CONF="$containersConf" run_podman pull --help
assert "$output" =~ "--retry .*performing pull \(default 10\)"
assert "$output" =~ "--retry-delay .*pull failures \(default \"5s\"\)"
CONTAINERS_CONF="$containersConf" run_podman push --help
assert "$output" =~ "--retry .*performing push \(default 10\)"
assert "$output" =~ "--retry-delay .*push failures \(default \"5s\"\)"
}
# END cooperation with skopeo
# END actual tests
###############################################################################