From e4af774a6588045dd67cbf664a0256faca7114b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 7 Nov 2023 20:41:09 +0100 Subject: [PATCH] Add support for --compat-auth-file in login/logout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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č --- cmd/podman/login.go | 2 -- cmd/podman/logout.go | 4 +--- docs/source/markdown/podman-login.1.md.in | 4 ++++ docs/source/markdown/podman-logout.1.md.in | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/podman/login.go b/cmd/podman/login.go index ce9568382dd7..d9777941fdf0 100644 --- a/cmd/podman/login.go +++ b/cmd/podman/login.go @@ -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) diff --git a/cmd/podman/logout.go b/cmd/podman/logout.go index 397edbb9a955..f6c086d819d3 100644 --- a/cmd/podman/logout.go +++ b/cmd/podman/logout.go @@ -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) } diff --git a/docs/source/markdown/podman-login.1.md.in b/docs/source/markdown/podman-login.1.md.in index dd826ba68b6c..646b7f5d6c8a 100644 --- a/docs/source/markdown/podman-login.1.md.in +++ b/docs/source/markdown/podman-login.1.md.in @@ -30,6 +30,10 @@ For more details about format and configurations of the auth.json file, see cont @@option authfile +#### **--compat-auth-file**=*path* + +Instead of updating the default credentials file, update the one at *path*, and use a Docker-compatible format. + @@option cert-dir #### **--get-login** diff --git a/docs/source/markdown/podman-logout.1.md.in b/docs/source/markdown/podman-logout.1.md.in index 893d3942e821..496c039732e3 100644 --- a/docs/source/markdown/podman-logout.1.md.in +++ b/docs/source/markdown/podman-logout.1.md.in @@ -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