GenerateExpectedCgroupParent returns cgroup parent in syntax expected by cgroup driver
(cgroupParent string)
| 442 | |
| 443 | // GenerateExpectedCgroupParent returns cgroup parent in syntax expected by cgroup driver |
| 444 | func (ds *dockerService) GenerateExpectedCgroupParent(cgroupParent string) (string, error) { |
| 445 | if cgroupParent != "" { |
| 446 | // if docker uses the systemd cgroup driver, it expects *.slice style names for cgroup parent. |
| 447 | // if we configured kubelet to use --cgroup-driver=cgroupfs, and docker is configured to use systemd driver |
| 448 | // docker will fail to launch the container because the name we provide will not be a valid slice. |
| 449 | // this is a very good thing. |
| 450 | if ds.cgroupDriver == "systemd" { |
| 451 | // Pass only the last component of the cgroup path to systemd. |
| 452 | cgroupParent = path.Base(cgroupParent) |
| 453 | } |
| 454 | } |
| 455 | logrus.Debugf("Setting cgroup parent to (%s)", cgroupParent) |
| 456 | return cgroupParent, nil |
| 457 | } |
| 458 | |
| 459 | // checkVersionCompatibility verifies whether docker is in a compatible version. |
| 460 | func (ds *dockerService) checkVersionCompatibility() error { |
no outgoing calls
no test coverage detected