vendor: update buildkit to 93b40706a007

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2022-12-13 11:03:53 +00:00
parent 5f4d463780
commit 163712a23b
26 changed files with 934 additions and 471 deletions

View File

@ -1,6 +1,8 @@
package result
import (
"reflect"
pb "github.com/moby/buildkit/frontend/gateway/pb"
digest "github.com/opencontainers/go-digest"
)
@ -15,12 +17,12 @@ var (
AttestationReasonProvenance = []byte("provenance")
)
type Attestation struct {
type Attestation[T any] struct {
Kind pb.AttestationKind
Metadata map[string][]byte
Ref string
Ref T
Path string
ContentFunc func() ([]byte, error)
@ -54,3 +56,23 @@ func FromDigestMap(m map[string]string) []digest.Digest {
}
return ds
}
func ConvertAttestation[U any, V any](a *Attestation[U], fn func(U) (V, error)) (*Attestation[V], error) {
var ref V
if reflect.ValueOf(a.Ref).IsValid() {
var err error
ref, err = fn(a.Ref)
if err != nil {
return nil, err
}
}
return &Attestation[V]{
Kind: a.Kind,
Metadata: a.Metadata,
Ref: ref,
Path: a.Path,
ContentFunc: a.ContentFunc,
InToto: a.InToto,
}, nil
}