Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
cli: Fix logout when specifying a registry
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Crone <christopher.crone@docker.com>
  • Loading branch information
chris-crone committed Jul 17, 2020
1 parent af0417c commit d1a929e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cli/cmd/logout/logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit d1a929e

Please sign in to comment.