Explorar o código

fixed #910. print user name to docker info output

Nan Monnand Deng %!s(int64=12) %!d(string=hai) anos
pai
achega
4179f25286
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      commands.go

+ 5 - 0
commands.go

@@ -495,6 +495,11 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
 		fmt.Fprintf(cli.out, "EventsListeners: %d\n", out.NEventsListener)
 		fmt.Fprintf(cli.out, "Kernel Version: %s\n", out.KernelVersion)
 	}
+	if cli.authConfig != nil {
+		fmt.Fprintf(cli.out, "Username: %v\n", cli.authConfig.Username)
+		// XXX Should we print registry address even if the user was not logged in?
+		fmt.Fprintf(cli.out, "Registry: %v\n", auth.IndexServerAddress())
+	}
 	if !out.MemoryLimit {
 		fmt.Fprintf(cli.err, "WARNING: No memory limit support\n")
 	}