mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
Vendor in latests containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
11
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
11
vendor/github.com/containers/common/libimage/pull.go
generated
vendored
@@ -442,8 +442,17 @@ func (r *Runtime) imagesIDsForManifest(manifestBytes []byte, sys *types.SystemCo
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("listing images by manifest digest: %w", err)
|
||||
}
|
||||
results := make([]string, 0, len(images))
|
||||
|
||||
// If you have additionStores defined and the same image stored in
|
||||
// both storage and additional store, it can be output twice.
|
||||
// Fixes github.com/containers/podman/issues/18647
|
||||
results := []string{}
|
||||
imageMap := map[string]bool{}
|
||||
for _, image := range images {
|
||||
if imageMap[image.ID] {
|
||||
continue
|
||||
}
|
||||
imageMap[image.ID] = true
|
||||
results = append(results, image.ID)
|
||||
}
|
||||
if len(results) == 0 {
|
||||
|
||||
9
vendor/github.com/containers/common/pkg/retry/retry.go
generated
vendored
9
vendor/github.com/containers/common/pkg/retry/retry.go
generated
vendored
@@ -32,11 +32,14 @@ func RetryIfNecessary(ctx context.Context, operation func() error, options *Opti
|
||||
|
||||
// IfNecessary retries the operation in exponential backoff with the retry Options.
|
||||
func IfNecessary(ctx context.Context, operation func() error, options *Options) error {
|
||||
if options.IsErrorRetryable == nil {
|
||||
options.IsErrorRetryable = IsErrorRetryable
|
||||
var isRetryable func(error) bool
|
||||
if options.IsErrorRetryable != nil {
|
||||
isRetryable = options.IsErrorRetryable
|
||||
} else {
|
||||
isRetryable = IsErrorRetryable
|
||||
}
|
||||
err := operation()
|
||||
for attempt := 0; err != nil && options.IsErrorRetryable(err) && attempt < options.MaxRetry; attempt++ {
|
||||
for attempt := 0; err != nil && isRetryable(err) && attempt < options.MaxRetry; attempt++ {
|
||||
delay := time.Duration(int(math.Pow(2, float64(attempt)))) * time.Second
|
||||
if options.Delay != 0 {
|
||||
delay = options.Delay
|
||||
|
||||
Reference in New Issue
Block a user