mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@9624ab4
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
18
vendor/github.com/moby/buildkit/solver/result/attestation.go
generated
vendored
18
vendor/github.com/moby/buildkit/solver/result/attestation.go
generated
vendored
@ -8,11 +8,11 @@ import (
|
||||
type Attestation struct {
|
||||
Kind pb.AttestationKind
|
||||
|
||||
Ref string
|
||||
Path string
|
||||
|
||||
InToto InTotoAttestation
|
||||
Ref string
|
||||
Path string
|
||||
ContentFunc func() ([]byte, error)
|
||||
|
||||
InToto InTotoAttestation
|
||||
}
|
||||
|
||||
type InTotoAttestation struct {
|
||||
@ -27,10 +27,18 @@ type InTotoSubject struct {
|
||||
Digest []digest.Digest
|
||||
}
|
||||
|
||||
func DigestMap(ds ...digest.Digest) map[string]string {
|
||||
func ToDigestMap(ds ...digest.Digest) map[string]string {
|
||||
m := map[string]string{}
|
||||
for _, d := range ds {
|
||||
m[d.Algorithm().String()] = d.Encoded()
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
func FromDigestMap(m map[string]string) []digest.Digest {
|
||||
var ds []digest.Digest
|
||||
for k, v := range m {
|
||||
ds = append(ds, digest.NewDigestFromEncoded(digest.Algorithm(k), v))
|
||||
}
|
||||
return ds
|
||||
}
|
||||
|
14
vendor/github.com/moby/buildkit/solver/result/result.go
generated
vendored
14
vendor/github.com/moby/buildkit/solver/result/result.go
generated
vendored
@ -41,16 +41,18 @@ func (r *Result[T]) AddRef(k string, ref T) {
|
||||
|
||||
func (r *Result[T]) AddAttestation(k string, v Attestation, ref T) {
|
||||
r.mu.Lock()
|
||||
if r.Refs == nil {
|
||||
r.Refs = map[string]T{}
|
||||
if reflect.ValueOf(ref).IsValid() {
|
||||
if r.Refs == nil {
|
||||
r.Refs = map[string]T{}
|
||||
}
|
||||
if !strings.HasPrefix(v.Ref, attestationRefPrefix) {
|
||||
v.Ref = attestationRefPrefix + identity.NewID()
|
||||
r.Refs[v.Ref] = ref
|
||||
}
|
||||
}
|
||||
if r.Attestations == nil {
|
||||
r.Attestations = map[string][]Attestation{}
|
||||
}
|
||||
if v.ContentFunc == nil && !strings.HasPrefix(v.Ref, attestationRefPrefix) {
|
||||
v.Ref = "attestation:" + identity.NewID()
|
||||
r.Refs[v.Ref] = ref
|
||||
}
|
||||
r.Attestations[k] = append(r.Attestations[k], v)
|
||||
r.mu.Unlock()
|
||||
}
|
||||
|
Reference in New Issue
Block a user