Skip to content

Commit 12d0869

Browse files
author
OpenShift Bot
authored
Merge pull request #12396 from legionus/verify-pullthrough-1.4
Merged by openshift-bot
2 parents 407c344 + 09ac7a5 commit 12d0869

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pkg/dockerregistry/server/manifestschema1handler.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,12 @@ func (h *manifestSchema1Handler) Payload() (mediaType string, payload []byte, ca
108108
func (h *manifestSchema1Handler) Verify(ctx context.Context, skipDependencyVerification bool) error {
109109
var errs distribution.ErrManifestVerification
110110

111-
// we want to verify that referenced blobs exist locally - thus using upstream repository object directly
112-
repo := h.repo.Repository
111+
// we want to verify that referenced blobs exist locally or are accessible via
112+
// pullthroughBlobStore. The base image of this image can be remote repository
113+
// and since we use pullthroughBlobStore all the layer existence checks will be
114+
// successful. This means that the docker client will not attempt to send them
115+
// to us as it will assume that the registry has them.
116+
repo := h.repo
113117

114118
if len(path.Join(h.repo.registryAddr, h.manifest.Name)) > reference.NameTotalLengthMax {
115119
errs = append(errs,

pkg/dockerregistry/server/manifestschema2handler.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ func (h *manifestSchema2Handler) Verify(ctx context.Context, skipDependencyVerif
6363
return nil
6464
}
6565

66-
// we want to verify that referenced blobs exist locally - thus using upstream repository object directly
67-
repo := h.repo.Repository
66+
// we want to verify that referenced blobs exist locally or are accessible via
67+
// pullthroughBlobStore. The base image of this image can be remote repository
68+
// and since we use pullthroughBlobStore all the layer existence checks will be
69+
// successful. This means that the docker client will not attempt to send them
70+
// to us as it will assume that the registry has them.
71+
repo := h.repo
6872

6973
target := h.manifest.Target()
7074
_, err := repo.Blobs(ctx).Stat(ctx, target.Digest)

0 commit comments

Comments
 (0)