api: client: remove redunant function to encode auth

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 505a56d6da69825e2ef1ebcf985a0a2e143d2966
Component: engine
This commit is contained in:
Antonio Murdaca
2016-01-29 14:07:54 +01:00
parent 426fb03f9a
commit 4ce68d47a6
2 changed files with 2 additions and 7 deletions
+2 -2
View File
@@ -40,8 +40,8 @@ func (cli *DockerCli) pullImageCustomOut(image string, out io.Writer) error {
return err
}
// Resolve the Auth config relevant for this server
encodedAuth, err := cli.encodeRegistryAuth(repoInfo.Index)
authConfig := registry.ResolveAuthConfig(cli.configFile.AuthConfigs, repoInfo.Index)
encodedAuth, err := encodeAuthToBase64(authConfig)
if err != nil {
return err
}
-5
View File
@@ -30,11 +30,6 @@ func encodeAuthToBase64(authConfig types.AuthConfig) (string, error) {
return base64.URLEncoding.EncodeToString(buf), nil
}
func (cli *DockerCli) encodeRegistryAuth(index *registrytypes.IndexInfo) (string, error) {
authConfig := registry.ResolveAuthConfig(cli.configFile.AuthConfigs, index)
return encodeAuthToBase64(authConfig)
}
func (cli *DockerCli) registryAuthenticationPrivilegedFunc(index *registrytypes.IndexInfo, cmdName string) client.RequestPrivilegeFunc {
return func() (string, error) {
fmt.Fprintf(cli.out, "\nPlease login prior to %s:\n", cmdName)