summaryrefslogtreecommitdiff
path: root/distribution
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2022-11-27 15:32:02 +0100
committerSebastiaan van Stijn <github@gone.nl>2022-11-28 20:29:19 +0100
commit85fddc0081339ea12e6c7bd71f702aa737f589b2 (patch)
tree676200644527066fca4f02f0288d7e4a696dcc5e /distribution
parent8feeaecb84cabb415a0d68db01f2bb425527f67c (diff)
downloaddocker-85fddc0081339ea12e6c7bd71f702aa737f589b2.tar.gz
distribution: remove unused RequireSchema2
It's never set, so we can remove it. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'distribution')
-rw-r--r--distribution/config.go2
-rw-r--r--distribution/pull_v2.go4
-rw-r--r--distribution/push_v2.go2
3 files changed, 1 insertions, 7 deletions
diff --git a/distribution/config.go b/distribution/config.go
index 86c7ee1309..9dd6a5431d 100644
--- a/distribution/config.go
+++ b/distribution/config.go
@@ -46,8 +46,6 @@ type Config struct {
// ReferenceStore manages tags. This value is optional, when excluded
// content will not be tagged.
ReferenceStore refstore.Store
- // RequireSchema2 ensures that only schema2 manifests are used.
- RequireSchema2 bool
}
// ImagePullConfig stores pull configuration.
diff --git a/distribution/pull_v2.go b/distribution/pull_v2.go
index 899ef09edb..0bef24d5f4 100644
--- a/distribution/pull_v2.go
+++ b/distribution/pull_v2.go
@@ -438,10 +438,6 @@ func (p *puller) pullTag(ctx context.Context, ref reference.Named, platform *spe
switch v := manifest.(type) {
case *schema1.SignedManifest:
- if p.config.RequireSchema2 {
- return false, fmt.Errorf("invalid manifest: not schema2")
- }
-
// give registries time to upgrade to schema2 and only warn if we know a registry has been upgraded long time ago
// TODO: condition to be removed
if reference.Domain(ref) == "docker.io" {
diff --git a/distribution/push_v2.go b/distribution/push_v2.go
index 5c540c0c5b..4332c44480 100644
--- a/distribution/push_v2.go
+++ b/distribution/push_v2.go
@@ -188,7 +188,7 @@ func (p *pusher) pushTag(ctx context.Context, ref reference.NamedTagged, id dige
putOptions := []distribution.ManifestServiceOption{distribution.WithTag(ref.Tag())}
if _, err = manSvc.Put(ctx, manifest, putOptions...); err != nil {
- if runtime.GOOS == "windows" || p.config.RequireSchema2 {
+ if runtime.GOOS == "windows" {
logrus.Warnf("failed to upload schema2 manifest: %v", err)
return err
}