Przeglądaj źródła

Merge pull request #18416 from toli/disable-official-repo-check-in-push

Removing the restriction to push to an 'official' repo
Jess Frazelle 9 lat temu
rodzic
commit
adf1ffd53b
1 zmienionych plików z 0 dodań i 12 usunięć
  1. 0 12
      api/client/push.go

+ 0 - 12
api/client/push.go

@@ -2,7 +2,6 @@ package client
 
 
 import (
 import (
 	"errors"
 	"errors"
-	"fmt"
 	"io"
 	"io"
 
 
 	"github.com/docker/distribution/reference"
 	"github.com/docker/distribution/reference"
@@ -44,17 +43,6 @@ func (cli *DockerCli) CmdPush(args ...string) error {
 	}
 	}
 	// Resolve the Auth config relevant for this server
 	// Resolve the Auth config relevant for this server
 	authConfig := registry.ResolveAuthConfig(cli.configFile.AuthConfigs, repoInfo.Index)
 	authConfig := registry.ResolveAuthConfig(cli.configFile.AuthConfigs, repoInfo.Index)
-	// If we're not using a custom registry, we know the restrictions
-	// applied to repository names and can warn the user in advance.
-	// Custom repositories can have different rules, and we must also
-	// allow pushing by image ID.
-	if repoInfo.Official {
-		username := authConfig.Username
-		if username == "" {
-			username = "<user>"
-		}
-		return fmt.Errorf("You cannot push a \"root\" repository. Please rename your repository to <user>/<repo> (ex: %s/%s)", username, repoInfo.LocalName)
-	}
 
 
 	requestPrivilege := cli.registryAuthenticationPrivilegedFunc(repoInfo.Index, "push")
 	requestPrivilege := cli.registryAuthenticationPrivilegedFunc(repoInfo.Index, "push")
 	if isTrusted() {
 	if isTrusted() {