Skip to content

Commit

Permalink
distribution: remove unused RequireSchema2
Browse files Browse the repository at this point in the history
It's never set, so we can remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 28, 2022
1 parent 8feeaec commit 85fddc0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions distribution/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions distribution/pull_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion distribution/push_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 85fddc0

Please sign in to comment.