...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package empty
17
18 import (
19 v1 "github.com/google/go-containerregistry/pkg/v1"
20 "github.com/google/go-containerregistry/pkg/v1/empty"
21 "github.com/google/go-containerregistry/pkg/v1/mutate"
22 "github.com/google/go-containerregistry/pkg/v1/types"
23
24 "github.com/sigstore/cosign/v2/pkg/oci"
25 )
26
27
28 func Signatures() oci.Signatures {
29 base := empty.Image
30 if !oci.DockerMediaTypes() {
31 base = mutate.MediaType(base, types.OCIManifestSchema1)
32 base = mutate.ConfigMediaType(base, types.OCIConfigJSON)
33 }
34 return &emptyImage{
35 Image: base,
36 }
37 }
38
39 type emptyImage struct {
40 v1.Image
41 }
42
43 var _ oci.Signatures = (*emptyImage)(nil)
44
45
46 func (*emptyImage) Get() ([]oci.Signature, error) {
47 return nil, nil
48 }
49
View as plain text