From 0d824c760ec2413f4df7855b9b6559424d01e556 Mon Sep 17 00:00:00 2001 From: toli Date: Thu, 3 Dec 2015 17:01:39 -0800 Subject: [PATCH] Removing the restriction to push to a 'official' repo Signed-off-by: toli --- api/client/push.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/api/client/push.go b/api/client/push.go index 77fb001464..19ea902073 100644 --- a/api/client/push.go +++ b/api/client/push.go @@ -2,7 +2,6 @@ package client import ( "errors" - "fmt" "io" "github.com/docker/distribution/reference" @@ -45,17 +44,6 @@ func (cli *DockerCli) CmdPush(args ...string) error { } // Resolve the Auth config relevant for this server 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 = "" - } - return fmt.Errorf("You cannot push a \"root\" repository. Please rename your repository to / (ex: %s/%s)", username, repoInfo.LocalName) - } requestPrivilege := cli.registryAuthenticationPrivilegedFunc(repoInfo.Index, "push") if isTrusted() {