Add CgroupDriver to docker info
Fixes: #19539 Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
parent
4eb7a4916f
commit
ca89c329b9
8 changed files with 18 additions and 0 deletions
|
@ -50,6 +50,7 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
|
|||
}
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "Execution Driver: %s\n", info.ExecutionDriver)
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "Logging Driver: %s\n", info.LoggingDriver)
|
||||
ioutils.FprintfIfNotEmpty(cli.out, "Cgroup Driver: %s\n", info.CgroupDriver)
|
||||
|
||||
fmt.Fprintf(cli.out, "Plugins: \n")
|
||||
fmt.Fprintf(cli.out, " Volume:")
|
||||
|
|
|
@ -362,6 +362,14 @@ func verifyContainerResources(resources *containertypes.Resources, sysInfo *sysi
|
|||
return warnings, nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) getCgroupDriver() string {
|
||||
cgroupDriver := "cgroupfs"
|
||||
if daemon.usingSystemd() {
|
||||
cgroupDriver = "systemd"
|
||||
}
|
||||
return cgroupDriver
|
||||
}
|
||||
|
||||
func usingSystemd(config *Config) bool {
|
||||
for _, option := range config.ExecOptions {
|
||||
key, val, err := parsers.ParseKeyValueOpt(option)
|
||||
|
|
|
@ -65,6 +65,10 @@ func checkKernel() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) getCgroupDriver() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// adaptContainerSettings is called during container creation to modify any
|
||||
// settings necessary in the HostConfig structure.
|
||||
func (daemon *Daemon) adaptContainerSettings(hostConfig *containertypes.HostConfig, adjustCPUShares bool) error {
|
||||
|
|
|
@ -83,6 +83,7 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
|||
SystemTime: time.Now().Format(time.RFC3339Nano),
|
||||
ExecutionDriver: daemon.ExecutionDriver().Name(),
|
||||
LoggingDriver: daemon.defaultLogConfig.Type,
|
||||
CgroupDriver: daemon.getCgroupDriver(),
|
||||
NEventsListener: daemon.EventsService.SubscribersCount(),
|
||||
KernelVersion: kernelVersion,
|
||||
OperatingSystem: operatingSystem,
|
||||
|
|
|
@ -121,6 +121,7 @@ This section lists each version from latest to oldest. Each listing includes a
|
|||
* `GET /networks/(name)` now returns an `EnableIPv6` field showing whether the network has ipv6 enabled or not.
|
||||
* `POST /containers/(name)/update` now supports updating container's restart policy.
|
||||
* `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work).
|
||||
* `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`.
|
||||
|
||||
### v1.22 API changes
|
||||
|
||||
|
|
|
@ -2128,6 +2128,7 @@ Display system-wide information
|
|||
|
||||
{
|
||||
"Architecture": "x86_64",
|
||||
"CgroupDriver": "cgroupfs",
|
||||
"Containers": 11,
|
||||
"ContainersRunning": 7,
|
||||
"ContainersStopped": 3,
|
||||
|
|
|
@ -33,6 +33,7 @@ For example:
|
|||
Dirperm1 Supported: true
|
||||
Execution Driver: native-0.2
|
||||
Logging Driver: json-file
|
||||
Cgroup Driver: cgroupfs
|
||||
Plugins:
|
||||
Volume: local
|
||||
Network: bridge null host
|
||||
|
|
|
@ -42,6 +42,7 @@ Here is a sample output:
|
|||
Dirs: 80
|
||||
Execution Driver: native-0.2
|
||||
Logging Driver: json-file
|
||||
Cgroup Driver: cgroupfs
|
||||
Plugins:
|
||||
Volume: local
|
||||
Network: bridge null host
|
||||
|
|
Loading…
Reference in a new issue