Fixes: #19539
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
| ... | ... |
@@ -50,6 +50,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
|
| 50 | 50 |
} |
| 51 | 51 |
ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver) |
| 52 | 52 |
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver) |
| 53 |
+ ioutils.FprintfIfNotEmpty(cli.out, "Cgroup Driver: %s\n", info.CgroupDriver) |
|
| 53 | 54 |
|
| 54 | 55 |
fmt.Fprintf(cli.out, "Plugins: \n") |
| 55 | 56 |
fmt.Fprintf(cli.out, " Volume:") |
| ... | ... |
@@ -362,6 +362,14 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi |
| 362 | 362 |
return warnings, nil |
| 363 | 363 |
} |
| 364 | 364 |
|
| 365 |
+func (daemon *Daemon) getCgroupDriver() string {
|
|
| 366 |
+ cgroupDriver := "cgroupfs" |
|
| 367 |
+ if daemon.usingSystemd() {
|
|
| 368 |
+ cgroupDriver = "systemd" |
|
| 369 |
+ } |
|
| 370 |
+ return cgroupDriver |
|
| 371 |
+} |
|
| 372 |
+ |
|
| 365 | 373 |
func usingSystemd(config *Config) bool {
|
| 366 | 374 |
for _, option := range config.ExecOptions {
|
| 367 | 375 |
key, val, err := parsers.ParseKeyValueOpt(option) |
| ... | ... |
@@ -65,6 +65,10 @@ func checkKernel() error {
|
| 65 | 65 |
return nil |
| 66 | 66 |
} |
| 67 | 67 |
|
| 68 |
+func (daemon *Daemon) getCgroupDriver() string {
|
|
| 69 |
+ return "" |
|
| 70 |
+} |
|
| 71 |
+ |
|
| 68 | 72 |
// adaptContainerSettings is called during container creation to modify any |
| 69 | 73 |
// settings necessary in the HostConfig structure. |
| 70 | 74 |
func (daemon *Daemon) adaptContainerSettings(hostConfig *containertypes.HostConfig, adjustCPUShares bool) error {
|
| ... | ... |
@@ -83,6 +83,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
| 83 | 83 |
SystemTime: time.Now().Format(time.RFC3339Nano), |
| 84 | 84 |
ExecutionDriver: daemon.ExecutionDriver().Name(), |
| 85 | 85 |
LoggingDriver: daemon.defaultLogConfig.Type, |
| 86 |
+ CgroupDriver: daemon.getCgroupDriver(), |
|
| 86 | 87 |
NEventsListener: daemon.EventsService.SubscribersCount(), |
| 87 | 88 |
KernelVersion: kernelVersion, |
| 88 | 89 |
OperatingSystem: operatingSystem, |
| ... | ... |
@@ -121,6 +121,7 @@ This section lists each version from latest to oldest. Each listing includes a |
| 121 | 121 |
* `GET /networks/(name)` now returns an `EnableIPv6` field showing whether the network has ipv6 enabled or not. |
| 122 | 122 |
* `POST /containers/(name)/update` now supports updating container's restart policy. |
| 123 | 123 |
* `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work). |
| 124 |
+* `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`. |
|
| 124 | 125 |
|
| 125 | 126 |
### v1.22 API changes |
| 126 | 127 |
|