mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 05:16:45 +00:00
attestations: replace intoto media type with vendored const
We were using a mixture of own custom const and the vendored const. For consistency, we should use only the vendored const everywhere. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
1 parent
81d19ad945
commit
709b72a70e
5 files changed
+6
-9
No files matched your search
@@ -437,7 +437,7 @@ func (ic *ImageWriter) commitAttestationsManifest(ctx context.Context, opts *Ima
|
||||
}
|
||||
digest := digest.FromBytes(data)
|
||||
desc := ocispecs.Descriptor{
|
||||
MediaType: attestationTypes.MediaTypeDockerSchema2AttestationType,
|
||||
MediaType: intoto.PayloadType,
|
||||
Digest: digest,
|
||||
Size: int64(len(data)),
|
||||
Annotations: map[string]string{
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
intoto "github.com/in-toto/in-toto-golang/in_toto"
|
||||
slsa02 "github.com/in-toto/in-toto-golang/in_toto/slsa_provenance/v0.2"
|
||||
controlapi "github.com/moby/buildkit/api/services/control"
|
||||
"github.com/moby/buildkit/cache"
|
||||
@@ -26,7 +27,6 @@ import (
|
||||
"github.com/moby/buildkit/solver/llbsolver/provenance"
|
||||
"github.com/moby/buildkit/solver/result"
|
||||
spb "github.com/moby/buildkit/sourcepolicy/pb"
|
||||
"github.com/moby/buildkit/util/attestation"
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
"github.com/moby/buildkit/util/compression"
|
||||
"github.com/moby/buildkit/util/entitlements"
|
||||
@@ -210,7 +210,7 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
w, err := s.history.OpenBlobWriter(ctx, attestation.MediaTypeDockerSchema2AttestationType)
|
||||
w, err := s.history.OpenBlobWriter(ctx, intoto.PayloadType)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package attestation
|
||||
|
||||
const (
|
||||
MediaTypeDockerSchema2AttestationType = "application/vnd.in-toto+json"
|
||||
|
||||
DockerAnnotationReferenceType = "vnd.docker.reference.type"
|
||||
DockerAnnotationReferenceDigest = "vnd.docker.reference.digest"
|
||||
DockerAnnotationReferenceDescription = "vnd.docker.reference.description"
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/containerd/containerd/reference"
|
||||
"github.com/containerd/containerd/remotes"
|
||||
"github.com/containerd/containerd/remotes/docker"
|
||||
"github.com/moby/buildkit/util/attestation"
|
||||
intoto "github.com/in-toto/in-toto-golang/in_toto"
|
||||
"github.com/moby/buildkit/util/contentutil"
|
||||
"github.com/moby/buildkit/util/leaseutil"
|
||||
"github.com/moby/buildkit/util/resolver/limited"
|
||||
@@ -174,7 +174,7 @@ func childrenConfigHandler(provider content.Provider, platform platforms.MatchCo
|
||||
descs = append(descs, index.Manifests...)
|
||||
}
|
||||
case images.MediaTypeDockerSchema2Config, ocispecs.MediaTypeImageConfig, docker.LegacyConfigMediaType,
|
||||
attestation.MediaTypeDockerSchema2AttestationType:
|
||||
intoto.PayloadType:
|
||||
// childless data types.
|
||||
return nil, nil
|
||||
default:
|
||||
|
||||
+1
-2
@@ -15,7 +15,6 @@ import (
|
||||
"github.com/containerd/containerd/remotes/docker"
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/moby/buildkit/session"
|
||||
"github.com/moby/buildkit/util/attestation"
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
"github.com/moby/buildkit/util/flightcontrol"
|
||||
"github.com/moby/buildkit/util/imageutil"
|
||||
@@ -250,7 +249,7 @@ func childrenHandler(provider content.Provider) images.HandlerFunc {
|
||||
case images.MediaTypeDockerSchema2Layer, images.MediaTypeDockerSchema2LayerGzip,
|
||||
images.MediaTypeDockerSchema2Config, ocispecs.MediaTypeImageConfig,
|
||||
ocispecs.MediaTypeImageLayer, ocispecs.MediaTypeImageLayerGzip,
|
||||
attestation.MediaTypeDockerSchema2AttestationType:
|
||||
intoto.PayloadType:
|
||||
// childless data types.
|
||||
return nil, nil
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user