Skip to content

Commit

Permalink
Make isTemporary a private function
Browse files Browse the repository at this point in the history
Signed-off-by: Somtochi Onyekwere <[email protected]>
  • Loading branch information
somtochiama committed May 25, 2023
1 parent 404b439 commit d511d8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oci/client/retry_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func WithRetryTransport(ctx context.Context, ref name.Reference, auth authn.Auth
var defaultRetryPredicate = func(err error) bool {
// Various failure modes here, as we're often reading from and writing to
// the network.
if IsTemporary(err) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, io.EOF) || errors.Is(err, syscall.EPIPE) || errors.Is(err, syscall.ECONNRESET) {
if isTemporary(err) || errors.Is(err, io.ErrUnexpectedEOF) || errors.Is(err, io.EOF) || errors.Is(err, syscall.EPIPE) || errors.Is(err, syscall.ECONNRESET) {
logs.Warn.Printf("retrying %v", err)
return true
}
Expand All @@ -71,8 +71,8 @@ type temporary interface {
Temporary() bool
}

// IsTemporary returns true if err implements Temporary() and it returns true.
func IsTemporary(err error) bool {
// isTemporary returns true if err implements Temporary() and it returns true.
func isTemporary(err error) bool {
if errors.Is(err, context.DeadlineExceeded) {
return false
}
Expand Down

0 comments on commit d511d8d

Please sign in to comment.