Merge pull request #2500 from adambkaplan/add-retry-delay

feat: Add `--retry-delay` Option
This commit is contained in:
Miloslav Trmač 2025-01-16 23:17:22 +01:00 committed by GitHub
commit 8380f284c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 29 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import (
"io" "io"
"os" "os"
"strings" "strings"
"time"
commonFlag "github.com/containers/common/pkg/flag" commonFlag "github.com/containers/common/pkg/flag"
"github.com/containers/common/pkg/retry" "github.com/containers/common/pkg/retry"
@ -184,6 +185,7 @@ func retryFlags() (pflag.FlagSet, *retry.Options) {
opts := retry.Options{} opts := retry.Options{}
fs := pflag.FlagSet{} fs := pflag.FlagSet{}
fs.IntVar(&opts.MaxRetry, "retry-times", 0, "the number of times to possibly retry") 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 return fs, &opts
} }

View File

@ -204,7 +204,11 @@ Precompute digests to ensure layers are not uploaded that already exist on the d
**--retry-times** **--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** **--src-username**

View File

@ -66,7 +66,11 @@ Bearer token for accessing the registry.
**--retry-times** **--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_ **--shared-blob-dir** _directory_

View File

@ -65,7 +65,11 @@ Registry token for accessing the registry.
**--retry-times** **--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_ **--shared-blob-dir** _directory_

View File

@ -39,7 +39,11 @@ Bearer token for accessing the registry.
**--retry-times** **--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_ **--tls-verify**=_bool_

View File

@ -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. **--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** **--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. 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.