Browse Source

Show active driver in docker info output

Alexander Larsson 11 năm trước cách đây
mục cha
commit
062810caed
4 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 1 0
      api_params.go
  2. 1 0
      commands.go
  3. 2 0
      graphdriver/driver.go
  4. 1 0
      server.go

+ 1 - 0
api_params.go

@@ -52,6 +52,7 @@ type APIInfo struct {
 	Debug              bool
 	Containers         int
 	Images             int
+	Driver             string `json:",omitempty"`
 	NFd                int    `json:",omitempty"`
 	NGoroutines        int    `json:",omitempty"`
 	MemoryLimit        bool   `json:",omitempty"`

+ 1 - 0
commands.go

@@ -460,6 +460,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
 
 	fmt.Fprintf(cli.out, "Containers: %d\n", out.Containers)
 	fmt.Fprintf(cli.out, "Images: %d\n", out.Images)
+	fmt.Fprintf(cli.out, "Driver: %s\n", out.Driver)
 	if out.Debug || os.Getenv("DEBUG") != "" {
 		fmt.Fprintf(cli.out, "Debug mode (server): %v\n", out.Debug)
 		fmt.Fprintf(cli.out, "Debug mode (client): %v\n", os.Getenv("DEBUG") != "")

+ 2 - 0
graphdriver/driver.go

@@ -11,6 +11,8 @@ import (
 type InitFunc func(root string) (Driver, error)
 
 type Driver interface {
+	String() string
+
 	Create(id, parent string) error
 	Remove(id string) error
 

+ 1 - 0
server.go

@@ -375,6 +375,7 @@ func (srv *Server) DockerInfo() *APIInfo {
 	return &APIInfo{
 		Containers:         len(srv.runtime.List()),
 		Images:             imgcount,
+		Driver:             srv.runtime.driver.String(),
 		MemoryLimit:        srv.runtime.capabilities.MemoryLimit,
 		SwapLimit:          srv.runtime.capabilities.SwapLimit,
 		IPv4Forwarding:     !srv.runtime.capabilities.IPv4ForwardingDisabled,