Browse Source

c8d/pull: Deprecation notice for schema1 manifests

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 year ago
parent
commit
3ff75aeb07
1 changed files with 6 additions and 1 deletions
  1. 6 1
      daemon/containerd/image_pull.go

+ 6 - 1
daemon/containerd/image_pull.go

@@ -13,6 +13,7 @@ import (
 	"github.com/distribution/reference"
 	"github.com/docker/docker/api/types/events"
 	"github.com/docker/docker/api/types/registry"
+	"github.com/docker/docker/distribution"
 	"github.com/docker/docker/errdefs"
 	"github.com/docker/docker/pkg/progress"
 	"github.com/docker/docker/pkg/streamformatter"
@@ -73,8 +74,12 @@ func (i *ImageService) PullImage(ctx context.Context, image, tagOrDigest string,
 	finishProgress := jobs.showProgress(ctx, out, pp)
 	defer finishProgress()
 
-	var sentPullingFrom bool
+	var sentPullingFrom, sentSchema1Deprecation bool
 	ah := images.HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
+		if desc.MediaType == images.MediaTypeDockerSchema1Manifest && !sentSchema1Deprecation {
+			progress.Message(out, "", distribution.DeprecatedSchema1ImageMessage(ref))
+			sentSchema1Deprecation = true
+		}
 		if images.IsManifestType(desc.MediaType) {
 			if !sentPullingFrom {
 				progress.Message(out, tagOrDigest, "Pulling from "+reference.Path(ref))