mirror of
https://github.com/distribution/distribution.git
synced 2025-09-25 22:23:38 +00:00
vendor: update gcs driver dependencies files
Signed-off-by: Flavian Missi <fmissi@redhat.com>
This commit is contained in:
15
vendor/github.com/googleapis/gax-go/v2/invoke.go
generated
vendored
15
vendor/github.com/googleapis/gax-go/v2/invoke.go
generated
vendored
@@ -33,13 +33,15 @@ import (
|
||||
"context"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/googleapis/gax-go/v2/apierror"
|
||||
)
|
||||
|
||||
// APICall is a user defined call stub.
|
||||
type APICall func(context.Context, CallSettings) error
|
||||
|
||||
// Invoke calls the given APICall,
|
||||
// performing retries as specified by opts, if any.
|
||||
// Invoke calls the given APICall, performing retries as specified by opts, if
|
||||
// any.
|
||||
func Invoke(ctx context.Context, call APICall, opts ...CallOption) error {
|
||||
var settings CallSettings
|
||||
for _, opt := range opts {
|
||||
@@ -71,9 +73,6 @@ func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
if settings.Retry == nil {
|
||||
return err
|
||||
}
|
||||
// Never retry permanent certificate errors. (e.x. if ca-certificates
|
||||
// are not installed). We should only make very few, targeted
|
||||
// exceptions: many (other) status=Unavailable should be retried, such
|
||||
@@ -83,6 +82,12 @@ func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper
|
||||
if strings.Contains(err.Error(), "x509: certificate signed by unknown authority") {
|
||||
return err
|
||||
}
|
||||
if apierr, ok := apierror.FromError(err); ok {
|
||||
err = apierr
|
||||
}
|
||||
if settings.Retry == nil {
|
||||
return err
|
||||
}
|
||||
if retryer == nil {
|
||||
if r := settings.Retry(); r != nil {
|
||||
retryer = r
|
||||
|
Reference in New Issue
Block a user