Skip to content

Commit 85fddc0

Browse files
committed
distribution: remove unused RequireSchema2
It's never set, so we can remove it. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 8feeaec commit 85fddc0

3 files changed

Lines changed: 1 addition & 7 deletions

File tree

distribution/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ type Config struct {
4646
// ReferenceStore manages tags. This value is optional, when excluded
4747
// content will not be tagged.
4848
ReferenceStore refstore.Store
49-
// RequireSchema2 ensures that only schema2 manifests are used.
50-
RequireSchema2 bool
5149
}
5250

5351
// ImagePullConfig stores pull configuration.

distribution/pull_v2.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,6 @@ func (p *puller) pullTag(ctx context.Context, ref reference.Named, platform *spe
438438

439439
switch v := manifest.(type) {
440440
case *schema1.SignedManifest:
441-
if p.config.RequireSchema2 {
442-
return false, fmt.Errorf("invalid manifest: not schema2")
443-
}
444-
445441
// give registries time to upgrade to schema2 and only warn if we know a registry has been upgraded long time ago
446442
// TODO: condition to be removed
447443
if reference.Domain(ref) == "docker.io" {

distribution/push_v2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (p *pusher) pushTag(ctx context.Context, ref reference.NamedTagged, id dige
188188

189189
putOptions := []distribution.ManifestServiceOption{distribution.WithTag(ref.Tag())}
190190
if _, err = manSvc.Put(ctx, manifest, putOptions...); err != nil {
191-
if runtime.GOOS == "windows" || p.config.RequireSchema2 {
191+
if runtime.GOOS == "windows" {
192192
logrus.Warnf("failed to upload schema2 manifest: %v", err)
193193
return err
194194
}

0 commit comments

Comments
 (0)