Browse code

/info: Add keys Architecture, OSType

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

Signed-off-by: Olle Jonsson <olle.jonsson@gmail.com>

Olle Jonsson authored on 2015/06/13 16:39:19
Showing 8 changed files
... ...
@@ -46,6 +46,8 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
46 46
 	ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
47 47
 	ioutils.FprintfIfNotEmpty(cli.out, "Kernel Version: %s\n", info.KernelVersion)
48 48
 	ioutils.FprintfIfNotEmpty(cli.out, "Operating System: %s\n", info.OperatingSystem)
49
+	ioutils.FprintfIfNotEmpty(cli.out, "OSType: %s\n", info.OSType)
50
+	ioutils.FprintfIfNotEmpty(cli.out, "Architecture: %s\n", info.Architecture)
49 51
 	fmt.Fprintf(cli.out, "CPUs: %d\n", info.NCPU)
50 52
 	fmt.Fprintf(cli.out, "Total Memory: %s\n", units.BytesSize(float64(info.MemTotal)))
51 53
 	ioutils.FprintfIfNotEmpty(cli.out, "Name: %s\n", info.Name)
... ...
@@ -207,6 +207,8 @@ type Info struct {
207 207
 	NEventsListener    int
208 208
 	KernelVersion      string
209 209
 	OperatingSystem    string
210
+	OSType             string
211
+	Architecture       string
210 212
 	IndexServerAddress string
211 213
 	RegistryConfig     *registry.ServiceConfig
212 214
 	InitSha1           string
... ...
@@ -75,6 +75,8 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
75 75
 		KernelVersion:      kernelVersion,
76 76
 		OperatingSystem:    operatingSystem,
77 77
 		IndexServerAddress: registry.IndexServer,
78
+		OSType:             runtime.GOOS,
79
+		Architecture:       runtime.GOARCH,
78 80
 		RegistryConfig:     daemon.RegistryService.Config,
79 81
 		InitSha1:           dockerversion.InitSHA1,
80 82
 		InitPath:           initPath,
... ...
@@ -1884,6 +1884,7 @@ Display system-wide information
1884 1884
     Content-Type: application/json
1885 1885
 
1886 1886
     {
1887
+        "Architecture": "amd64",
1887 1888
         "Containers": 11,
1888 1889
         "CpuCfsPeriod": true,
1889 1890
         "CpuCfsQuota": true,
... ...
@@ -1915,6 +1916,7 @@ Display system-wide information
1915 1915
         "Name": "prod-server-42",
1916 1916
         "NoProxy": "9.81.1.160",
1917 1917
         "OomKillDisable": true,
1918
+        "OSType": "linux",
1918 1919
         "OperatingSystem": "Boot2Docker",
1919 1920
         "RegistryConfig": {
1920 1921
             "IndexConfigs": {
... ...
@@ -31,6 +31,8 @@ For example:
31 31
     Execution Driver: native-0.2
32 32
     Logging Driver: json-file
33 33
     Kernel Version: 3.19.0-22-generic
34
+    OSType: linux
35
+    Architecture: amd64
34 36
     Operating System: Ubuntu 15.04
35 37
     CPUs: 24
36 38
     Total Memory: 62.86 GiB
... ...
@@ -23,6 +23,8 @@ func (s *DockerSuite) TestInfoApi(c *check.C) {
23 23
 		"LoggingDriver",
24 24
 		"OperatingSystem",
25 25
 		"NCPU",
26
+		"OSType",
27
+		"Architecture",
26 28
 		"MemTotal",
27 29
 		"KernelVersion",
28 30
 		"Driver",
... ...
@@ -19,6 +19,8 @@ func (s *DockerSuite) TestInfoEnsureSucceeds(c *check.C) {
19 19
 		"Containers:",
20 20
 		"Images:",
21 21
 		"Execution Driver:",
22
+		"OSType:",
23
+		"Architecture:",
22 24
 		"Logging Driver:",
23 25
 		"Operating System:",
24 26
 		"CPUs:",
... ...
@@ -41,6 +41,8 @@ Here is a sample output:
41 41
     Logging Driver: json-file
42 42
     Kernel Version: 3.13.0-24-generic
43 43
     Operating System: Ubuntu 14.04 LTS
44
+    OSType: linux
45
+    Architecture: amd64
44 46
     CPUs: 1
45 47
     Total Memory: 2 GiB
46 48