Jelajahi Sumber

/info: Add keys Architecture, OSType

  - introduces Swarm-relevant keys, see #13634
  - docs updated

Signed-off-by: Olle Jonsson <olle.jonsson@gmail.com>
Olle Jonsson 10 tahun lalu
induk
melakukan
4e8fcd4002

+ 2 - 0
api/client/info.go

@@ -46,6 +46,8 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
 	ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
 	ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
 	ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
 	ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
 	ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
 	ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
+	ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType)
+	ioutils.FprintfIfNotEmpty(cli.out, "Architecture: %s\n", info.Architecture)
 	fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
 	fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
 	fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
 	fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
 	ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)
 	ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)

+ 2 - 0
api/types/types.go

@@ -207,6 +207,8 @@ type Info struct {
 	NEventsListener    int
 	NEventsListener    int
 	KernelVersion      string
 	KernelVersion      string
 	OperatingSystem    string
 	OperatingSystem    string
+	OSType             string
+	Architecture       string
 	IndexServerAddress string
 	IndexServerAddress string
 	RegistryConfig     *registry.ServiceConfig
 	RegistryConfig     *registry.ServiceConfig
 	InitSha1           string
 	InitSha1           string

+ 2 - 0
daemon/info.go

@@ -75,6 +75,8 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
 		KernelVersion:      kernelVersion,
 		KernelVersion:      kernelVersion,
 		OperatingSystem:    operatingSystem,
 		OperatingSystem:    operatingSystem,
 		IndexServerAddress: registry.IndexServer,
 		IndexServerAddress: registry.IndexServer,
+		OSType:             runtime.GOOS,
+		Architecture:       runtime.GOARCH,
 		RegistryConfig:     daemon.RegistryService.Config,
 		RegistryConfig:     daemon.RegistryService.Config,
 		InitSha1:           dockerversion.InitSHA1,
 		InitSha1:           dockerversion.InitSHA1,
 		InitPath:           initPath,
 		InitPath:           initPath,

+ 2 - 0
docs/reference/api/docker_remote_api_v1.21.md

@@ -1884,6 +1884,7 @@ Display system-wide information
     Content-Type: application/json
     Content-Type: application/json
 
 
     {
     {
+        "Architecture": "amd64",
         "Containers": 11,
         "Containers": 11,
         "CpuCfsPeriod": true,
         "CpuCfsPeriod": true,
         "CpuCfsQuota": true,
         "CpuCfsQuota": true,
@@ -1915,6 +1916,7 @@ Display system-wide information
         "Name": "prod-server-42",
         "Name": "prod-server-42",
         "NoProxy": "9.81.1.160",
         "NoProxy": "9.81.1.160",
         "OomKillDisable": true,
         "OomKillDisable": true,
+        "OSType": "linux",
         "OperatingSystem": "Boot2Docker",
         "OperatingSystem": "Boot2Docker",
         "RegistryConfig": {
         "RegistryConfig": {
             "IndexConfigs": {
             "IndexConfigs": {

+ 2 - 0
docs/reference/commandline/info.md

@@ -31,6 +31,8 @@ For example:
     Execution Driver: native-0.2
     Execution Driver: native-0.2
     Logging Driver: json-file
     Logging Driver: json-file
     Kernel Version: 3.19.0-22-generic
     Kernel Version: 3.19.0-22-generic
+    OSType: linux
+    Architecture: amd64
     Operating System: Ubuntu 15.04
     Operating System: Ubuntu 15.04
     CPUs: 24
     CPUs: 24
     Total Memory: 62.86 GiB
     Total Memory: 62.86 GiB

+ 2 - 0
integration-cli/docker_api_info_test.go

@@ -23,6 +23,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
 		"LoggingDriver",
 		"LoggingDriver",
 		"OperatingSystem",
 		"OperatingSystem",
 		"NCPU",
 		"NCPU",
+		"OSType",
+		"Architecture",
 		"MemTotal",
 		"MemTotal",
 		"KernelVersion",
 		"KernelVersion",
 		"Driver",
 		"Driver",

+ 2 - 0
integration-cli/docker_cli_info_test.go

@@ -19,6 +19,8 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
 		"Containers:",
 		"Containers:",
 		"Images:",
 		"Images:",
 		"Execution Driver:",
 		"Execution Driver:",
+		"OSType:",
+		"Architecture:",
 		"Logging Driver:",
 		"Logging Driver:",
 		"Operating System:",
 		"Operating System:",
 		"CPUs:",
 		"CPUs:",

+ 2 - 0
man/docker-info.1.md

@@ -41,6 +41,8 @@ Here is a sample output:
     Logging Driver: json-file
     Logging Driver: json-file
     Kernel Version: 3.13.0-24-generic
     Kernel Version: 3.13.0-24-generic
     Operating System: Ubuntu 14.04 LTS
     Operating System: Ubuntu 14.04 LTS
+    OSType: linux
+    Architecture: amd64
     CPUs: 1
     CPUs: 1
     Total Memory: 2 GiB
     Total Memory: 2 GiB