Browse code

api: client: remove redunant function to encode auth

Signed-off-by: Antonio Murdaca <runcom@redhat.com>

Antonio Murdaca authored on 2016/01/25 01:59:24
Showing 2 changed files
... ...
@@ -40,8 +40,8 @@ func (cli *DockerCli) pullImageCustomOut(image string, out io.Writer) error {
40 40
 		return err
41 41
 	}
42 42
 
43
-	// Resolve the Auth config relevant for this server
44
-	encodedAuth, err := cli.encodeRegistryAuth(repoInfo.Index)
43
+	authConfig := registry.ResolveAuthConfig(cli.configFile.AuthConfigs, repoInfo.Index)
44
+	encodedAuth, err := encodeAuthToBase64(authConfig)
45 45
 	if err != nil {
46 46
 		return err
47 47
 	}
... ...
@@ -30,11 +30,6 @@ func encodeAuthToBase64(authConfig types.AuthConfig) (string, error) {
30 30
 	return base64.URLEncoding.EncodeToString(buf), nil
31 31
 }
32 32
 
33
-func (cli *DockerCli) encodeRegistryAuth(index *registrytypes.IndexInfo) (string, error) {
34
-	authConfig := registry.ResolveAuthConfig(cli.configFile.AuthConfigs, index)
35
-	return encodeAuthToBase64(authConfig)
36
-}
37
-
38 33
 func (cli *DockerCli) registryAuthenticationPrivilegedFunc(index *registrytypes.IndexInfo, cmdName string) client.RequestPrivilegeFunc {
39 34
 	return func() (string, error) {
40 35
 		fmt.Fprintf(cli.out, "\nPlease login prior to %s:\n", cmdName)