@@ -55,53 +55,54 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
55
55
// liveRestoreEnabled := criu.CheckForCriu() && configInfo.RuntimeSupportsCheckpoint()
56
56
info := & handlers.Info {
57
57
Info : dockerSystem.Info {
58
- Architecture : goRuntime .GOARCH ,
59
- BridgeNfIP6tables : ! sysInfo .BridgeNFCallIP6TablesDisabled ,
60
- BridgeNfIptables : ! sysInfo .BridgeNFCallIPTablesDisabled ,
61
- CPUCfsPeriod : sysInfo .CPUCfsPeriod ,
62
- CPUCfsQuota : sysInfo .CPUCfsQuota ,
63
- CPUSet : sysInfo .Cpuset ,
64
- CPUShares : sysInfo .CPUShares ,
65
- CgroupDriver : configInfo .Engine .CgroupManager ,
66
- ContainerdCommit : dockerSystem.Commit {},
67
- Containers : infoData .Store .ContainerStore .Number ,
68
- ContainersPaused : stateInfo [define .ContainerStatePaused ],
69
- ContainersRunning : stateInfo [define .ContainerStateRunning ],
70
- ContainersStopped : stateInfo [define .ContainerStateStopped ] + stateInfo [define .ContainerStateExited ],
71
- Debug : log .IsLevelEnabled (log .DebugLevel ),
72
- DefaultRuntime : configInfo .Engine .OCIRuntime ,
73
- DockerRootDir : infoData .Store .GraphRoot ,
74
- Driver : infoData .Store .GraphDriverName ,
75
- DriverStatus : getGraphStatus (infoData .Store .GraphStatus ),
76
- ExperimentalBuild : true ,
77
- GenericResources : nil ,
78
- HTTPProxy : getEnv ("http_proxy" ),
79
- HTTPSProxy : getEnv ("https_proxy" ),
80
- ID : uuid .New ().String (),
81
- IPv4Forwarding : ! sysInfo .IPv4ForwardingDisabled ,
82
- Images : infoData .Store .ImageStore .Number ,
83
- IndexServerAddress : "" ,
84
- InitBinary : "" ,
85
- InitCommit : dockerSystem.Commit {},
86
- Isolation : "" ,
87
- KernelMemoryTCP : false ,
88
- KernelVersion : infoData .Host .Kernel ,
89
- Labels : nil ,
90
- LiveRestoreEnabled : false ,
91
- LoggingDriver : "" ,
92
- MemTotal : infoData .Host .MemTotal ,
93
- MemoryLimit : sysInfo .MemoryLimit ,
94
- NCPU : goRuntime .NumCPU (),
95
- NEventsListener : 0 ,
96
- NFd : getFdCount (),
97
- NGoroutines : goRuntime .NumGoroutine (),
98
- Name : infoData .Host .Hostname ,
99
- NoProxy : getEnv ("no_proxy" ),
100
- OSType : goRuntime .GOOS ,
101
- OSVersion : infoData .Host .Distribution .Version ,
102
- OomKillDisable : sysInfo .OomKillDisable ,
103
- OperatingSystem : infoData .Host .Distribution .Distribution ,
104
- PidsLimit : sysInfo .PidsLimit ,
58
+ Architecture : goRuntime .GOARCH ,
59
+ BridgeNfIP6tables : ! sysInfo .BridgeNFCallIP6TablesDisabled ,
60
+ BridgeNfIptables : ! sysInfo .BridgeNFCallIPTablesDisabled ,
61
+ CPUCfsPeriod : sysInfo .CPUCfsPeriod ,
62
+ CPUCfsQuota : sysInfo .CPUCfsQuota ,
63
+ CPUSet : sysInfo .Cpuset ,
64
+ CPUShares : sysInfo .CPUShares ,
65
+ CgroupDriver : configInfo .Engine .CgroupManager ,
66
+ ContainerdCommit : dockerSystem.Commit {},
67
+ Containers : infoData .Store .ContainerStore .Number ,
68
+ ContainersPaused : stateInfo [define .ContainerStatePaused ],
69
+ ContainersRunning : stateInfo [define .ContainerStateRunning ],
70
+ ContainersStopped : stateInfo [define .ContainerStateStopped ] + stateInfo [define .ContainerStateExited ],
71
+ Debug : log .IsLevelEnabled (log .DebugLevel ),
72
+ DefaultAddressPools : getDefaultAddressPools (configInfo ),
73
+ DefaultRuntime : configInfo .Engine .OCIRuntime ,
74
+ DockerRootDir : infoData .Store .GraphRoot ,
75
+ Driver : infoData .Store .GraphDriverName ,
76
+ DriverStatus : getGraphStatus (infoData .Store .GraphStatus ),
77
+ ExperimentalBuild : true ,
78
+ GenericResources : nil ,
79
+ HTTPProxy : getEnv ("http_proxy" ),
80
+ HTTPSProxy : getEnv ("https_proxy" ),
81
+ ID : uuid .New ().String (),
82
+ IPv4Forwarding : ! sysInfo .IPv4ForwardingDisabled ,
83
+ Images : infoData .Store .ImageStore .Number ,
84
+ IndexServerAddress : "" ,
85
+ InitBinary : "" ,
86
+ InitCommit : dockerSystem.Commit {},
87
+ Isolation : "" ,
88
+ KernelMemoryTCP : false ,
89
+ KernelVersion : infoData .Host .Kernel ,
90
+ Labels : nil ,
91
+ LiveRestoreEnabled : false ,
92
+ LoggingDriver : "" ,
93
+ MemTotal : infoData .Host .MemTotal ,
94
+ MemoryLimit : sysInfo .MemoryLimit ,
95
+ NCPU : goRuntime .NumCPU (),
96
+ NEventsListener : 0 ,
97
+ NFd : getFdCount (),
98
+ NGoroutines : goRuntime .NumGoroutine (),
99
+ Name : infoData .Host .Hostname ,
100
+ NoProxy : getEnv ("no_proxy" ),
101
+ OSType : goRuntime .GOOS ,
102
+ OSVersion : infoData .Host .Distribution .Version ,
103
+ OomKillDisable : sysInfo .OomKillDisable ,
104
+ OperatingSystem : infoData .Host .Distribution .Distribution ,
105
+ PidsLimit : sysInfo .PidsLimit ,
105
106
Plugins : dockerSystem.PluginsInfo {
106
107
Volume : infoData .Plugins .Volume ,
107
108
Network : infoData .Plugins .Network ,
@@ -237,3 +238,24 @@ func getEnv(value string) string {
237
238
}
238
239
return ""
239
240
}
241
+
242
+ func getDefaultAddressPools (configInfo * config.Config ) []dockerSystem.NetworkAddressPool {
243
+ // Convert DefaultSubnetPools to DefaultAddressPools
244
+ if len (configInfo .Network .DefaultSubnetPools ) == 0 {
245
+ return nil
246
+ }
247
+
248
+ pools := make ([]dockerSystem.NetworkAddressPool , 0 , len (configInfo .Network .DefaultSubnetPools ))
249
+ for _ , pool := range configInfo .Network .DefaultSubnetPools {
250
+ if pool .Base == nil {
251
+ continue
252
+ }
253
+
254
+ pools = append (pools , dockerSystem.NetworkAddressPool {
255
+ Base : pool .Base .String (),
256
+ Size : pool .Size ,
257
+ })
258
+ }
259
+
260
+ return pools
261
+ }
0 commit comments