Merge pull request #20388 from hqhq/hq_add_cgroup_driver_info

Add CgroupDriver to docker info
This commit is contained in:
Vincent Demeester 2016-03-02 23:17:27 +01:00
commit 508a17baba
8 changed files with 18 additions and 0 deletions

View File

@ -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:")

View File

@ -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)

View File

@ -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 {

View File

@ -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,

View File

@ -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

View File

@ -2128,6 +2128,7 @@ Display system-wide information
{
"Architecture": "x86_64",
"CgroupDriver": "cgroupfs",
"Containers": 11,
"ContainersRunning": 7,
"ContainersStopped": 3,

View File

@ -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

View File

@ -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