@@ -53,15 +53,15 @@ const (
53
53
//
54
54
// References:
55
55
// - https://docs.docker.com/registry/spec/api/#digest-header
56
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#pull
56
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#pull
57
57
headerDockerContentDigest = "Docker-Content-Digest"
58
58
59
59
// headerOCIFiltersApplied is the "OCI-Filters-Applied" header.
60
60
// If present on the response, it contains a comma-separated list of the
61
61
// applied filters.
62
62
//
63
63
// Reference:
64
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#listing-referrers
64
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#listing-referrers
65
65
headerOCIFiltersApplied = "OCI-Filters-Applied"
66
66
67
67
// headerOCISubject is the "OCI-Subject" header.
@@ -74,7 +74,7 @@ const (
74
74
// referrers.
75
75
//
76
76
// References:
77
- // - Latest spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#listing-referrers
77
+ // - Latest spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#listing-referrers
78
78
// - Compatible spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#listing-referrers
79
79
const filterTypeArtifactType = "artifactType"
80
80
@@ -138,16 +138,16 @@ type Repository struct {
138
138
// is successfully uploaded.
139
139
// - If true, the old referrers index is kept.
140
140
// By default, it is disabled (set to false). See also:
141
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#referrers-tag-schema
142
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#pushing-manifests-with-subject
143
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#deleting-manifests
141
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#referrers-tag-schema
142
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#pushing-manifests-with-subject
143
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#deleting-manifests
144
144
SkipReferrersGC bool
145
145
146
146
// HandleWarning handles the warning returned by the remote server.
147
147
// Callers SHOULD deduplicate warnings from multiple associated responses.
148
148
//
149
149
// References:
150
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#warnings
150
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#warnings
151
151
// - https://www.rfc-editor.org/rfc/rfc7234#section-5.5
152
152
HandleWarning func (warning Warning )
153
153
@@ -217,9 +217,9 @@ func (r *Repository) clone() *Repository {
217
217
// SetReferrersCapability returns ErrReferrersCapabilityAlreadySet if the
218
218
// Referrers API capability has been already set.
219
219
// - When the capability is set to true, the Referrers() function will always
220
- // request the Referrers API. Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#listing-referrers
220
+ // request the Referrers API. Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#listing-referrers
221
221
// - When the capability is set to false, the Referrers() function will always
222
- // request the Referrers Tag. Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#referrers-tag-schema
222
+ // request the Referrers Tag. Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#referrers-tag-schema
223
223
// - When the capability is not set, the Referrers() function will automatically
224
224
// determine which API to use.
225
225
func (r * Repository ) SetReferrersCapability (capable bool ) error {
@@ -393,7 +393,7 @@ func (r *Repository) ParseReference(reference string) (registry.Reference, error
393
393
// of the Tags list.
394
394
//
395
395
// References:
396
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#content-discovery
396
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#content-discovery
397
397
// - https://docs.docker.com/registry/spec/api/#tags
398
398
func (r * Repository ) Tags (ctx context.Context , last string , fn func (tags []string ) error ) error {
399
399
ctx = auth .AppendRepositoryScope (ctx , r .Reference , auth .ActionPull )
@@ -452,7 +452,7 @@ func (r *Repository) tags(ctx context.Context, last string, fn func(tags []strin
452
452
// Predecessors returns the descriptors of image or artifact manifests directly
453
453
// referencing the given manifest descriptor.
454
454
// Predecessors internally leverages Referrers.
455
- // Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#listing-referrers
455
+ // Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#listing-referrers
456
456
func (r * Repository ) Predecessors (ctx context.Context , desc ocispec.Descriptor ) ([]ocispec.Descriptor , error ) {
457
457
var res []ocispec.Descriptor
458
458
if err := r .Referrers (ctx , desc , "" , func (referrers []ocispec.Descriptor ) error {
@@ -471,7 +471,7 @@ func (r *Repository) Predecessors(ctx context.Context, desc ocispec.Descriptor)
471
471
// If artifactType is not empty, only referrers of the same artifact type are
472
472
// fed to fn.
473
473
//
474
- // Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#listing-referrers
474
+ // Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#listing-referrers
475
475
func (r * Repository ) Referrers (ctx context.Context , desc ocispec.Descriptor , artifactType string , fn func (referrers []ocispec.Descriptor ) error ) error {
476
476
state := r .loadReferrersState ()
477
477
if state == referrersStateUnsupported {
@@ -570,7 +570,7 @@ func (r *Repository) referrersPageByAPI(ctx context.Context, artifactType string
570
570
referrers := index .Manifests
571
571
if artifactType != "" {
572
572
// check both filters header and filters annotations for compatibility
573
- // latest spec for filters header: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#listing-referrers
573
+ // latest spec for filters header: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#listing-referrers
574
574
// older spec for filters annotations: https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#listing-referrers
575
575
filtersHeader := resp .Header .Get (headerOCIFiltersApplied )
576
576
filtersAnnotation := index .Annotations [spec .AnnotationReferrersFiltersApplied ]
@@ -592,7 +592,7 @@ func (r *Repository) referrersPageByAPI(ctx context.Context, artifactType string
592
592
// referencing the given manifest descriptor by requesting referrers tag.
593
593
// fn is called for the referrers result. If artifactType is not empty,
594
594
// only referrers of the same artifact type are fed to fn.
595
- // reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#backwards-compatibility
595
+ // reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#backwards-compatibility
596
596
func (r * Repository ) referrersByTagSchema (ctx context.Context , desc ocispec.Descriptor , artifactType string , fn func (referrers []ocispec.Descriptor ) error ) error {
597
597
referrersTag := buildReferrersTag (desc )
598
598
_ , referrers , err := r .referrersFromIndex (ctx , referrersTag )
@@ -809,7 +809,7 @@ func (s *blobStore) Mount(ctx context.Context, desc ocispec.Descriptor, fromRepo
809
809
// push it. If the caller has provided a getContent function, we
810
810
// can use that, otherwise pull the content from the source repository.
811
811
//
812
- // [spec]: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#mounting-a-blob-from-another-repository
812
+ // [spec]: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#mounting-a-blob-from-another-repository
813
813
814
814
var r io.ReadCloser
815
815
if getContent != nil {
@@ -844,7 +844,7 @@ func (s *blobStore) sibling(otherRepoName string) *blobStore {
844
844
// References:
845
845
// - https://docs.docker.com/registry/spec/api/#pushing-an-image
846
846
// - https://docs.docker.com/registry/spec/api/#initiate-blob-upload
847
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#pushing-a-blob-monolithically
847
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#pushing-a-blob-monolithically
848
848
func (s * blobStore ) Push (ctx context.Context , expected ocispec.Descriptor , content io.Reader ) error {
849
849
// start an upload
850
850
// pushing usually requires both pull and push actions.
@@ -1154,7 +1154,7 @@ func (s *manifestStore) deleteWithIndexing(ctx context.Context, target ocispec.D
1154
1154
// on manifest delete.
1155
1155
//
1156
1156
// References:
1157
- // - Latest spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#deleting-manifests
1157
+ // - Latest spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#deleting-manifests
1158
1158
// - Compatible spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#deleting-manifests
1159
1159
func (s * manifestStore ) indexReferrersForDelete (ctx context.Context , desc ocispec.Descriptor , manifestJSON []byte ) error {
1160
1160
var manifest struct {
@@ -1340,7 +1340,7 @@ func (s *manifestStore) push(ctx context.Context, expected ocispec.Descriptor, c
1340
1340
1341
1341
// checkOCISubjectHeader checks the "OCI-Subject" header in the response and
1342
1342
// sets referrers capability accordingly.
1343
- // Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#pushing-manifests-with-subject
1343
+ // Reference: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#pushing-manifests-with-subject
1344
1344
func (s * manifestStore ) checkOCISubjectHeader (resp * http.Response ) {
1345
1345
// If the "OCI-Subject" header is set, it indicates that the registry
1346
1346
// supports the Referrers API and has processed the subject of the manifest.
@@ -1391,7 +1391,7 @@ func (s *manifestStore) pushWithIndexing(ctx context.Context, expected ocispec.D
1391
1391
// on manifest push.
1392
1392
//
1393
1393
// References:
1394
- // - Latest spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#pushing-manifests-with-subject
1394
+ // - Latest spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#pushing-manifests-with-subject
1395
1395
// - Compatible spec: https://github.com/opencontainers/distribution-spec/blob/v1.1.0-rc1/spec.md#pushing-manifests-with-subject
1396
1396
func (s * manifestStore ) indexReferrersForPush (ctx context.Context , desc ocispec.Descriptor , manifestJSON []byte ) error {
1397
1397
var subject ocispec.Descriptor
@@ -1448,8 +1448,8 @@ func (s *manifestStore) indexReferrersForPush(ctx context.Context, desc ocispec.
1448
1448
// updateReferrersIndex updates the referrers index for desc referencing subject
1449
1449
// on manifest push and manifest delete.
1450
1450
// References:
1451
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#pushing-manifests-with-subject
1452
- // - https://github.com/opencontainers/distribution-spec/blob/v1.1.0 /spec.md#deleting-manifests
1451
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#pushing-manifests-with-subject
1452
+ // - https://github.com/opencontainers/distribution-spec/blob/v1.1.1 /spec.md#deleting-manifests
1453
1453
func (s * manifestStore ) updateReferrersIndex (ctx context.Context , subject ocispec.Descriptor , change referrerChange ) (err error ) {
1454
1454
referrersTag := buildReferrersTag (subject )
1455
1455
0 commit comments