@@ -22,7 +22,7 @@ import (
2222)
2323
2424// EncodeAuthToBase64 serializes the auth configuration as JSON base64 payload
25- func EncodeAuthToBase64 (authConfig types .AuthConfig ) (string , error ) {
25+ func EncodeAuthToBase64 (authConfig registrytypes .AuthConfig ) (string , error ) {
2626 buf , err := json .Marshal (authConfig )
2727 if err != nil {
2828 return "" , err
@@ -52,19 +52,19 @@ func RegistryAuthenticationPrivilegedFunc(cli Cli, index *registrytypes.IndexInf
5252// ResolveAuthConfig is like registry.ResolveAuthConfig, but if using the
5353// default index, it uses the default index name for the daemon's platform,
5454// not the client's platform.
55- func ResolveAuthConfig (_ context.Context , cli Cli , index * registrytypes.IndexInfo ) types .AuthConfig {
55+ func ResolveAuthConfig (_ context.Context , cli Cli , index * registrytypes.IndexInfo ) registrytypes .AuthConfig {
5656 configKey := index .Name
5757 if index .Official {
5858 configKey = registry .IndexServer
5959 }
6060
6161 a , _ := cli .ConfigFile ().GetAuthConfig (configKey )
62- return types .AuthConfig (a )
62+ return registrytypes .AuthConfig (a )
6363}
6464
6565// GetDefaultAuthConfig gets the default auth config given a serverAddress
6666// If credentials for given serverAddress exists in the credential store, the configuration will be populated with values in it
67- func GetDefaultAuthConfig (cli Cli , checkCredStore bool , serverAddress string , isDefaultRegistry bool ) (types .AuthConfig , error ) {
67+ func GetDefaultAuthConfig (cli Cli , checkCredStore bool , serverAddress string , isDefaultRegistry bool ) (registrytypes .AuthConfig , error ) {
6868 if ! isDefaultRegistry {
6969 serverAddress = registry .ConvertToHostname (serverAddress )
7070 }
@@ -73,19 +73,19 @@ func GetDefaultAuthConfig(cli Cli, checkCredStore bool, serverAddress string, is
7373 if checkCredStore {
7474 authconfig , err = cli .ConfigFile ().GetAuthConfig (serverAddress )
7575 if err != nil {
76- return types .AuthConfig {
76+ return registrytypes .AuthConfig {
7777 ServerAddress : serverAddress ,
7878 }, err
7979 }
8080 }
8181 authconfig .ServerAddress = serverAddress
8282 authconfig .IdentityToken = ""
83- res := types .AuthConfig (authconfig )
83+ res := registrytypes .AuthConfig (authconfig )
8484 return res , nil
8585}
8686
8787// ConfigureAuth handles prompting of user's username and password if needed
88- func ConfigureAuth (cli Cli , flUser , flPassword string , authconfig * types .AuthConfig , isDefaultRegistry bool ) error {
88+ func ConfigureAuth (cli Cli , flUser , flPassword string , authconfig * registrytypes .AuthConfig , isDefaultRegistry bool ) error {
8989 // On Windows, force the use of the regular OS stdin stream. Fixes #14336/#14210
9090 if runtime .GOOS == "windows" {
9191 cli .SetIn (streams .NewIn (os .Stdin ))
@@ -175,14 +175,14 @@ func RetrieveAuthTokenFromImage(ctx context.Context, cli Cli, image string) (str
175175}
176176
177177// resolveAuthConfigFromImage retrieves that AuthConfig using the image string
178- func resolveAuthConfigFromImage (ctx context.Context , cli Cli , image string ) (types .AuthConfig , error ) {
178+ func resolveAuthConfigFromImage (ctx context.Context , cli Cli , image string ) (registrytypes .AuthConfig , error ) {
179179 registryRef , err := reference .ParseNormalizedNamed (image )
180180 if err != nil {
181- return types .AuthConfig {}, err
181+ return registrytypes .AuthConfig {}, err
182182 }
183183 repoInfo , err := registry .ParseRepositoryInfo (registryRef )
184184 if err != nil {
185- return types .AuthConfig {}, err
185+ return registrytypes .AuthConfig {}, err
186186 }
187187 return ResolveAuthConfig (ctx , cli , repoInfo .Index ), nil
188188}
0 commit comments