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

Commit 3fe5e22

Browse files
cpuguy83thaJeztah
authored andcommitted
Move schema1 deprecation notice
Currently we show this deprecation notice for any error returned by a registry. Registries can return an error for any number of reasons. Instead let's show the deprecation notice only if the fallback was successful. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit 6859bc7eeec05c1dde93e80ff53eab78c222f3ec) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 100d240d86dd1e97a0f1f8ea575f7e4a6f27ff50 Component: engine
1 parent 0caa03a commit 3fe5e22

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)