8000 Merge pull request #40671 from cpuguy83/schema2v1_dep_notice_on_error… · moby/moby@d959c20 · GitHub
[go: up one dir, main page]

Skip to content

Commit d959c20

Browse files
authored
Merge pull request #40671 from cpuguy83/schema2v1_dep_notice_on_error_only
Move schema1 deprecation notice
2 parents af74dac + 6859bc7 commit d959c20

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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)
0