diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-08 12:54:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 12:54:41 +0200 |
commit | cc6a77cc88bb997080f773d93d420025ce92da1d (patch) | |
tree | 0bd6781ada70e35a1629821a225a4683ac5b5384 /cmd/podman/logout.go | |
parent | ab518cdba02b85a32d3c2bce4c0b65dcdea4dfcc (diff) | |
parent | 45f731aa493f8e98e81dc0f3adc8ec80cf494567 (diff) | |
download | podman-cc6a77cc88bb997080f773d93d420025ce92da1d.tar.gz podman-cc6a77cc88bb997080f773d93d420025ce92da1d.tar.bz2 podman-cc6a77cc88bb997080f773d93d420025ce92da1d.zip |
Merge pull request #6078 from QiWang19/auth-common
auth pkg support emtpy argument & enable login test
Diffstat (limited to 'cmd/podman/logout.go')
-rw-r--r-- | cmd/podman/logout.go | 17 |
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) } |