mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to master@ae9d0f5
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
46
vendor/github.com/moby/buildkit/frontend/gateway/client/attestation.go
generated
vendored
Normal file
46
vendor/github.com/moby/buildkit/frontend/gateway/client/attestation.go
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
pb "github.com/moby/buildkit/frontend/gateway/pb"
|
||||
"github.com/moby/buildkit/solver/result"
|
||||
)
|
||||
|
||||
func AttestationToPB(a *result.Attestation) (*pb.Attestation, error) {
|
||||
subjects := make([]*pb.InTotoSubject, len(a.InToto.Subjects))
|
||||
for i, subject := range a.InToto.Subjects {
|
||||
subjects[i] = &pb.InTotoSubject{
|
||||
Kind: subject.Kind,
|
||||
Name: subject.Name,
|
||||
Digest: subject.Digest,
|
||||
}
|
||||
}
|
||||
|
||||
return &pb.Attestation{
|
||||
Kind: a.Kind,
|
||||
Path: a.Path,
|
||||
Ref: a.Ref,
|
||||
InTotoPredicateType: a.InToto.PredicateType,
|
||||
InTotoSubjects: subjects,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func AttestationFromPB(a *pb.Attestation) (*result.Attestation, error) {
|
||||
subjects := make([]result.InTotoSubject, len(a.InTotoSubjects))
|
||||
for i, subject := range a.InTotoSubjects {
|
||||
subjects[i] = result.InTotoSubject{
|
||||
Kind: subject.Kind,
|
||||
Name: subject.Name,
|
||||
Digest: subject.Digest,
|
||||
}
|
||||
}
|
||||
|
||||
return &result.Attestation{
|
||||
Kind: a.Kind,
|
||||
Path: a.Path,
|
||||
Ref: a.Ref,
|
||||
InToto: result.InTotoAttestation{
|
||||
PredicateType: a.InTotoPredicateType,
|
||||
Subjects: subjects,
|
||||
},
|
||||
}, nil
|
||||
}
|
Reference in New Issue
Block a user