Skip to content

Commit

Permalink
Add support for --compat-auth-file in login/logout
Browse files Browse the repository at this point in the history
This mostly just inherits the c/common/pkg/auth implementation,
except that AuthFilePath and DockerCompatAuthFilePath can not be set
simultaneously, so don't unnecessarily explicitly set AuthFilePath.
c/common already handles that.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
  • Loading branch information
mtrmac committed Nov 7, 2023
1 parent 94177a2 commit 8220f20
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions cmd/podman/login.go
Expand Up @@ -96,8 +96,6 @@ func login(cmd *cobra.Command, args []string) error {
}

sysCtx := &types.SystemContext{
AuthFilePath: loginOptions.AuthFile,
DockerCertPath: loginOptions.CertDir,
DockerInsecureSkipTLSVerify: skipTLS,
}
setRegistriesConfPath(sysCtx)
Expand Down
4 changes: 1 addition & 3 deletions cmd/podman/logout.go
Expand Up @@ -48,9 +48,7 @@ func init() {

// Implementation of podman-logout.
func logout(cmd *cobra.Command, args []string) error {
sysCtx := &types.SystemContext{
AuthFilePath: logoutOptions.AuthFile,
}
sysCtx := &types.SystemContext{}
setRegistriesConfPath(sysCtx)
return auth.Logout(sysCtx, &logoutOptions, args)
}
4 changes: 4 additions & 0 deletions docs/source/markdown/podman-login.1.md.in
Expand Up @@ -32,6 +32,10 @@ For more details about format and configurations of the auth.json file, see cont

@@option cert-dir

#### **--compat-auth-file**=*path*

Instead of updating the default credentials file, update the one at *path*, and use a Docker-compatible format.

#### **--get-login**

Return the logged-in user for the registry. Return error if no login is found.
Expand Down
4 changes: 4 additions & 0 deletions docs/source/markdown/podman-logout.1.md.in
Expand Up @@ -27,6 +27,10 @@ Remove the cached credentials for all registries in the auth file

@@option authfile

#### **--compat-auth-file**=*path*

Instead of updating the default credentials file, update the one at *path*, and use a Docker-compatible format.

#### **--help**, **-h**

Print usage statement
Expand Down

0 comments on commit 8220f20

Please sign in to comment.