@@ -14,14 +14,15 @@ type LoginOptions struct {
1414 // CLI flags managed by the FlagSet returned by GetLoginFlags
1515 // Callers that use GetLoginFlags should not need to touch these values at all; callers that use
1616 // other CLI frameworks should set them based on user input.
17- AuthFile string
18- CertDir string
19- Password string
20- Username string
21- StdinPassword bool
22- GetLoginSet bool
23- Verbose bool // set to true for verbose output
24- AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries
17+ AuthFile string
18+ DockerCompatAuthFile string
19+ CertDir string
20+ Password string
21+ Username string
22+ StdinPassword bool
23+ GetLoginSet bool
24+ Verbose bool // set to true for verbose output
25+ AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries
2526 // Options caller can set
2627 Stdin io.Reader // set to os.Stdin
2728 Stdout io.Writer // set to os.Stdout
@@ -34,9 +35,10 @@ type LogoutOptions struct {
3435 // CLI flags managed by the FlagSet returned by GetLogoutFlags
3536 // Callers that use GetLogoutFlags should not need to touch these values at all; callers that use
3637 // other CLI frameworks should set them based on user input.
37- AuthFile string
38- All bool
39- AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries
38+ AuthFile string
39+ DockerCompatAuthFile string
40+ All bool
41+ AcceptRepositories bool // set to true to allow namespaces or repositories rather than just registries
4042 // Options caller can set
4143 Stdout io.Writer // set to os.Stdout
4244 AcceptUnspecifiedRegistry bool // set to true if allows logout with unspecified registry
@@ -46,6 +48,7 @@ type LogoutOptions struct {
4648func GetLoginFlags (flags * LoginOptions ) * pflag.FlagSet {
4749 fs := pflag.FlagSet {}
4850 fs .StringVar (& flags .AuthFile , "authfile" , "" , "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override" )
51+ fs .StringVar (& flags .DockerCompatAuthFile , "compat-auth-file" , "" , "path of a Docker-compatible config file to update instead" )
4952 fs .StringVar (& flags .CertDir , "cert-dir" , "" , "use certificates at the specified path to access the registry" )
5053 fs .StringVarP (& flags .Password , "password" , "p" , "" , "Password for registry" )
5154 fs .StringVarP (& flags .Username , "username" , "u" , "" , "Username for registry" )
@@ -59,6 +62,7 @@ func GetLoginFlags(flags *LoginOptions) *pflag.FlagSet {
5962func GetLoginFlagsCompletions () completion.FlagCompletions {
6063 flagCompletion := completion.FlagCompletions {}
6164 flagCompletion ["authfile" ] = completion .AutocompleteDefault
65+ flagCompletion ["compat-auth-file" ] = completion .AutocompleteDefault
6266 flagCompletion ["cert-dir" ] = completion .AutocompleteDefault
6367 flagCompletion ["password" ] = completion .AutocompleteNone
6468 flagCompletion ["username" ] = completion .AutocompleteNone
@@ -69,6 +73,7 @@ func GetLoginFlagsCompletions() completion.FlagCompletions {
6973func GetLogoutFlags (flags * LogoutOptions ) * pflag.FlagSet {
7074 fs := pflag.FlagSet {}
7175 fs .StringVar (& flags .AuthFile , "authfile" , "" , "path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override" )
76+ fs .StringVar (& flags .DockerCompatAuthFile , "compat-auth-file" , "" , "path of a Docker-compatible config file to update instead" )
7277 fs .BoolVarP (& flags .All , "all" , "a" , false , "Remove the cached credentials for all registries in the auth file" )
7378 return & fs
7479}
@@ -77,5 +82,6 @@ func GetLogoutFlags(flags *LogoutOptions) *pflag.FlagSet {
7782func GetLogoutFlagsCompletions () completion.FlagCompletions {
7883 flagCompletion := completion.FlagCompletions {}
7984 flagCompletion ["authfile" ] = completion .AutocompleteDefault
85+ flagCompletion ["compat-auth-file" ] = completion .AutocompleteDefault
8086 return flagCompletion
8187}
0 commit comments