From af0417c75814d5aee70ff0a1fed5b6ca4772b729 Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Fri, 17 Jul 2020 16:23:15 +0200 Subject: [PATCH 1/2] cli: Refactor Azure logout Signed-off-by: Christopher Crone --- cli/cmd/logout/{azurelogout.go => azure.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cli/cmd/logout/{azurelogout.go => azure.go} (100%) diff --git a/cli/cmd/logout/azurelogout.go b/cli/cmd/logout/azure.go similarity index 100% rename from cli/cmd/logout/azurelogout.go rename to cli/cmd/logout/azure.go From d1a929eb7fe9ca59e120b0d8fe9a3141da87fe3e Mon Sep 17 00:00:00 2001 From: Christopher Crone Date: Fri, 17 Jul 2020 16:23:52 +0200 Subject: [PATCH 2/2] cli: Fix logout when specifying a registry Signed-off-by: Christopher Crone --- cli/cmd/logout/logout.go | 2 +- tests/e2e/e2e_test.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/cmd/logout/logout.go b/cli/cmd/logout/logout.go index 9c02853e..0ea967a4 100644 --- a/cli/cmd/logout/logout.go +++ b/cli/cmd/logout/logout.go @@ -12,7 +12,7 @@ func Command() *cobra.Command { Use: "logout [SERVER]", Short: "Log out from a Docker registry or cloud backend", Long: "Log out from a Docker registry or cloud backend.\nIf no server is specified, the default is defined by the daemon.", - Args: cobra.MaximumNArgs(0), + Args: cobra.MaximumNArgs(1), RunE: runLogout, } diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go index f80e39ff..17c49ada 100644 --- a/tests/e2e/e2e_test.go +++ b/tests/e2e/e2e_test.go @@ -133,6 +133,9 @@ func (s *E2eSuite) TestClassicLogin() { output, err := s.NewDockerCommand("login", "someregistry.docker.io").Exec() Expect(output).To(ContainSubstring("Cannot perform an interactive login from a non TTY device")) Expect(err).NotTo(BeNil()) + output, err = s.NewDockerCommand("logout", "someregistry.docker.io").Exec() + Expect(output).To(ContainSubstring("Removing login credentials for someregistry.docker.io")) + Expect(err).To(BeNil()) } func (s *E2eSuite) TestCloudLogin() {