bump github.com/moby/buildkit to v0.13.0 (#351)

* bump github.com/moby/buildkit to v0.13.0

Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com>

* fix: update dep usage based on newer version

Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com>

* remove empty line

Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com>

* ci: bump golang to 1.21.x

* Bump moby

* debug

---------

Signed-off-by: Nianyu Shen <nianyu@spectrocloud.com>
Co-authored-by: Nianyu Shen <nianyu@spectrocloud.com>
This commit is contained in:
Ettore Di Giacinto
2024-03-15 09:26:32 +01:00
committed by GitHub
parent c47bf4833a
commit 4c788ccbd1
1779 changed files with 127547 additions and 71408 deletions

View File

@@ -18,6 +18,7 @@ package retry
import (
"context"
"errors"
"fmt"
"github.com/google/go-containerregistry/internal/retry/wait"
@@ -36,7 +37,7 @@ type temporary interface {
// IsTemporary returns true if err implements Temporary() and it returns true.
func IsTemporary(err error) bool {
if err == context.DeadlineExceeded {
if errors.Is(err, context.DeadlineExceeded) {
return false
}
if te, ok := err.(temporary); ok && te.Temporary() {
@@ -75,3 +76,19 @@ func Retry(f func() error, p Predicate, backoff wait.Backoff) (err error) {
wait.ExponentialBackoff(backoff, condition)
return
}
type contextKey string
var key = contextKey("never")
// Never returns a context that signals something should not be retried.
// This is a hack and can be used to communicate across package boundaries
// to avoid retry amplification.
func Never(ctx context.Context) context.Context {
return context.WithValue(ctx, key, true)
}
// Ever returns true if the context was wrapped by Never.
func Ever(ctx context.Context) bool {
return ctx.Value(key) == nil
}