Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit ec54eff

Browse files
authored
Merge pull request #40681 from thaJeztah/19.03_backport_schema2v1_dep_notice_on_error_only
[19.03 backport] Move schema1 deprecation notice Upstream-commit: 5ed8f9a2032280e8ad51dc2a20bc1c50531fdc65 Component: engine
2 parents bba0c57 + 3fe5e22 commit ec54eff

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

components/engine/distribution/push_v2.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,7 @@ func (p *v2Pusher) pushV2Tag(ctx context.Context, ref reference.NamedTagged, id
188188

189189
logrus.Warnf("failed to upload schema2 manifest: %v - falling back to schema1", err)
190190

191-
msg := fmt.Sprintf("[DEPRECATION NOTICE] registry v2 schema1 support will be removed in an upcoming release. Please contact admins of the %s registry NOW to avoid future disruption. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/", reference.Domain(ref))
192-
logrus.Warn(msg)
193-
progress.Message(p.config.ProgressOutput, "", msg)
194-
191+
// Note: this fallback is deprecated, see log messages below
195192
manifestRef, err := reference.WithTag(p.repo.Named(), ref.Tag())
196193
if err != nil {
197194
return err
@@ -205,6 +202,11 @@ func (p *v2Pusher) pushV2Tag(ctx context.Context, ref reference.NamedTagged, id
205202
if _, err = manSvc.Put(ctx, manifest, putOptions...); err != nil {
206203
return err
207204
}
205+
206+
// schema2 failed but schema1 succeeded
207+
msg := fmt.Sprintf("[DEPRECATION NOTICE] registry v2 schema1 support will be removed in an upcoming release. Please contact admins of the %s registry NOW to avoid future disruption. More information at https://docs.docker.com/registry/spec/deprecated-schema-v1/", reference.Domain(ref))
208+
logrus.Warn(msg)
209+
progress.Message(p.config.ProgressOutput, "", msg)
208210
}
209211

210212
var canonicalManifest []byte

0 commit comments

Comments
 (0)