distribution: Extract schema1 deprecation notice

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-09-19 14:51:21 +02:00
parent 68b67b3230
commit 2cb94ade6c
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A
2 changed files with 6 additions and 2 deletions

View file

@ -212,3 +212,7 @@ func (e reservedNameError) Error() string {
}
func (e reservedNameError) Forbidden() {}
func DeprecatedSchema1ImageMessage(ref reference.Named) string {
return fmt.Sprintf("[DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of %s to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/", ref)
}

View file

@ -435,7 +435,7 @@ func (p *puller) pullTag(ctx context.Context, ref reference.Named, platform *oci
switch v := manifest.(type) {
case *schema1.SignedManifest:
msg := fmt.Sprintf("[DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of %s to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/", ref)
msg := DeprecatedSchema1ImageMessage(ref)
log.G(ctx).Warn(msg)
progress.Message(p.config.ProgressOutput, "", msg)
@ -868,7 +868,7 @@ func (p *puller) pullManifestList(ctx context.Context, ref reference.Named, mfst
switch v := manifest.(type) {
case *schema1.SignedManifest:
msg := fmt.Sprintf("[DEPRECATION NOTICE] Docker Image Format v1, and Docker Image manifest version 2, schema 1 support will be removed in an upcoming release. Suggest the author of %s to upgrade the image to the OCI Format, or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/", ref)
msg := DeprecatedSchema1ImageMessage(ref)
log.G(ctx).Warn(msg)
progress.Message(p.config.ProgressOutput, "", msg)