Merge pull request #397 from docker/fix-logout

Fix logout
This commit is contained in:
Chris Crone 2020-07-17 16:36:25 +02:00 committed by GitHub
commit 45604a6350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -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,
}

View File

@ -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() {