Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: add delay between --retry-times #2476

Open
xwu2intel opened this issue Dec 16, 2024 · 1 comment
Open

feature request: add delay between --retry-times #2476

xwu2intel opened this issue Dec 16, 2024 · 1 comment
Labels
kind/feature A request for, or a PR adding, new functionality

Comments

@xwu2intel
Copy link

xwu2intel commented Dec 16, 2024

This is my calling sequence:

ssh -4 <user>@<ip> -O ControlMaster=auto -fNL localhost:13340:localhost:20048     # localhost:20048 is the remote registry
skopeo copy --retry-times 10 --dest-tls-verify=false docker://<image> docker://localhost:13340/<image>
ssh -4 <user>@<ip> -O cancel -L localhost:13340:localhost:20048

As the remote registry is not directly accessible, I have to use ssh port forwarding as a bridge.

This works fine if there is no error during skopeo copy. If there is any error in the first try, then any subsequent retries will fail as well. This is because the remote registry is not immediately responding to subsequent connections, until after a time delay.

This following sequence works fine in the case of retries:

ssh -4 <user>@<ip> -O ControlMaster=auto -fNL localhost:13340:localhost:20048     # localhost:20048 is the remote registry
for retries in { 1..10 }; do
    skopeo copy --dest-tls-verify=false docker://<image> docker://<image> && break
    sleep 5s
done
ssh -4 <user>@<ip> -O cancel -L localhost:13340:localhost:20048

The request is to add time delay between retries.

@mtrmac mtrmac added the kind/feature A request for, or a PR adding, new functionality label Dec 17, 2024
@mtrmac
Copy link
Contributor

mtrmac commented Dec 17, 2024

Thanks for reaching out.

c/common/pkg/retry already implements a Delay option, so we just need to hook that up in the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for, or a PR adding, new functionality
Projects
None yet
Development

No branches or pull requests

2 participants