Merge pull request #1093 from monnand/910-login-info

* Runtime: fixed #910. print user name to docker info output
This commit is contained in:
Guillaume J. Charmes 2013-08-07 15:09:55 -07:00
commit 65a4e30825
3 changed files with 30 additions and 20 deletions

View File

@ -27,6 +27,7 @@ type APIInfo struct {
LXCVersion string `json:",omitempty"`
NEventsListener int `json:",omitempty"`
KernelVersion string `json:",omitempty"`
IndexServerAddress string `json:",omitempty"`
}
type APITop struct {

View File

@ -496,6 +496,14 @@ 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 len(out.IndexServerAddress) != 0 {
u := cli.configFile.Configs[out.IndexServerAddress].Username
if len(u) > 0 {
fmt.Fprintf(cli.out, "Username: %v\n", u)
fmt.Fprintf(cli.out, "Registry: %v\n", out.IndexServerAddress)
}
}
if !out.MemoryLimit {
fmt.Fprintf(cli.err, "WARNING: No memory limit support\n")
}

View File

@ -275,6 +275,7 @@ func (srv *Server) DockerInfo() *APIInfo {
LXCVersion: lxcVersion,
NEventsListener: len(srv.events),
KernelVersion: kernelVersion,
IndexServerAddress: auth.IndexServerAddress(),
}
}