소스 검색

distribution: remove unused RequireSchema2

It's never set, so we can remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 년 전
부모
커밋
85fddc0081
3개의 변경된 파일1개의 추가작업 그리고 7개의 파일을 삭제
  1. 0 2
      distribution/config.go
  2. 0 4
      distribution/pull_v2.go
  3. 1 1
      distribution/push_v2.go

+ 0 - 2
distribution/config.go

@@ -46,8 +46,6 @@ type Config struct {
 	// ReferenceStore manages tags. This value is optional, when excluded
 	// ReferenceStore manages tags. This value is optional, when excluded
 	// content will not be tagged.
 	// content will not be tagged.
 	ReferenceStore refstore.Store
 	ReferenceStore refstore.Store
-	// RequireSchema2 ensures that only schema2 manifests are used.
-	RequireSchema2 bool
 }
 }
 
 
 // ImagePullConfig stores pull configuration.
 // ImagePullConfig stores pull configuration.

+ 0 - 4
distribution/pull_v2.go

@@ -438,10 +438,6 @@ func (p *puller) pullTag(ctx context.Context, ref reference.Named, platform *spe
 
 
 	switch v := manifest.(type) {
 	switch v := manifest.(type) {
 	case *schema1.SignedManifest:
 	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
 		// 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
 		// TODO: condition to be removed
 		if reference.Domain(ref) == "docker.io" {
 		if reference.Domain(ref) == "docker.io" {

+ 1 - 1
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())}
 	putOptions := []distribution.ManifestServiceOption{distribution.WithTag(ref.Tag())}
 	if _, err = manSvc.Put(ctx, manifest, putOptions...); err != nil {
 	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)
 			logrus.Warnf("failed to upload schema2 manifest: %v", err)
 			return err
 			return err
 		}
 		}