Skip to content

Commit

Permalink
Merge pull request #2500 from adambkaplan/add-retry-delay
Browse files Browse the repository at this point in the history
feat: Add `--retry-delay` Option
  • Loading branch information
mtrmac authored Jan 16, 2025
2 parents 3315da4 + ed0efc6 commit 8380f28
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cmd/skopeo/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"os"
"strings"
"time"

commonFlag "github.com/containers/common/pkg/flag"
"github.com/containers/common/pkg/retry"
Expand Down Expand Up @@ -184,6 +185,7 @@ func retryFlags() (pflag.FlagSet, *retry.Options) {
opts := retry.Options{}
fs := pflag.FlagSet{}
fs.IntVar(&opts.MaxRetry, "retry-times", 0, "the number of times to possibly retry")
fs.DurationVar(&opts.Delay, "retry-delay", 0*time.Second, "Fixed delay between retries. If not set, retry uses an exponential backoff delay.")
return fs, &opts
}

Expand Down
6 changes: 5 additions & 1 deletion docs/skopeo-copy.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ Precompute digests to ensure layers are not uploaded that already exist on the d

**--retry-times**

The number of times to retry. Retry wait time will be exponentially increased based on the number of failed attempts.
The number of times to retry.

**--retry-delay**

Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts.

**--src-username**

Expand Down
6 changes: 5 additions & 1 deletion docs/skopeo-delete.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ Bearer token for accessing the registry.

**--retry-times**

The number of times to retry. Retry wait time will be exponentially increased based on the number of failed attempts.
The number of times to retry.

**--retry-delay**

Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts.

**--shared-blob-dir** _directory_

Expand Down
6 changes: 5 additions & 1 deletion docs/skopeo-inspect.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ Registry token for accessing the registry.

**--retry-times**

The number of times to retry; retry wait time will be exponentially increased based on the number of failed attempts.
The number of times to retry.

**--retry-delay**

Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts.

**--shared-blob-dir** _directory_

Expand Down
6 changes: 5 additions & 1 deletion docs/skopeo-list-tags.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ Bearer token for accessing the registry.

**--retry-times**

The number of times to retry. Retry wait time will be exponentially increased based on the number of failed attempts.
The number of times to retry.

**--retry-delay**

Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts.

**--tls-verify**=_bool_

Expand Down
8 changes: 7 additions & 1 deletion docs/skopeo-sync.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ The passphare to use when signing with `--sign-by` or `--sign-by-sigstore-privat

**--dest-registry-token** _Bearer token_ for accessing the destination registry.

**--retry-times** the number of times to retry, retry wait time will be exponentially increased based on the number of failed attempts.
**--retry-times**

The number of times to retry.

**--retry-delay**

Fixed delay between retries. If not set (or set to 0s), retry wait time will be exponentially increased based on the number of failed attempts.

**--keep-going**
If any errors occur during copying of images, those errors are logged and the process continues syncing rest of the images and finally fails at the end.
Expand Down

0 comments on commit 8380f28

Please sign in to comment.