summaryrefslogtreecommitdiff
path: root/cmd/podman/logout.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-05-05 12:25:41 -0400
committerQi Wang <qiwan@redhat.com>2020-05-07 09:48:13 -0400
commit45f731aa493f8e98e81dc0f3adc8ec80cf494567 (patch)
treeafe04bba8db19ce1b9558ded498971d3a4c18cac /cmd/podman/logout.go
parent062c7b8a9411b7d115f85c2df58aeea760b001bc (diff)
downloadpodman-45f731aa493f8e98e81dc0f3adc8ec80cf494567.tar.gz
podman-45f731aa493f8e98e81dc0f3adc8ec80cf494567.tar.bz2
podman-45f731aa493f8e98e81dc0f3adc8ec80cf494567.zip
enable login/logut unspecified args
Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd/podman/logout.go')
-rw-r--r--cmd/podman/logout.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/cmd/podman/logout.go b/cmd/podman/logout.go
index c21711fc0..d0afc21b4 100644
--- a/cmd/podman/logout.go
+++ b/cmd/podman/logout.go
@@ -7,7 +7,7 @@ import (
"github.com/containers/image/v5/types"
"github.com/containers/libpod/cmd/podman/registry"
"github.com/containers/libpod/pkg/domain/entities"
- "github.com/pkg/errors"
+ "github.com/containers/libpod/pkg/registries"
"github.com/spf13/cobra"
)
@@ -39,19 +39,14 @@ func init() {
flags.AddFlagSet(auth.GetLogoutFlags(&logoutOptions))
logoutOptions.Stdin = os.Stdin
logoutOptions.Stdout = os.Stdout
+ logoutOptions.AcceptUnspecifiedRegistry = true
}
// Implementation of podman-logout.
func logout(cmd *cobra.Command, args []string) error {
- sysCtx := types.SystemContext{AuthFilePath: logoutOptions.AuthFile}
-
- registry := ""
- if len(args) > 0 {
- if logoutOptions.All {
- return errors.New("--all takes no arguments")
- }
- registry = args[0]
+ sysCtx := types.SystemContext{
+ AuthFilePath: logoutOptions.AuthFile,
+ SystemRegistriesConfPath: registries.SystemRegistriesConfPath(),
}
-
- return auth.Logout(&sysCtx, &logoutOptions, registry)
+ return auth.Logout(&sysCtx, &logoutOptions, args)
}