oci: call wait on conmon if cgroup move fails
if we fail to move conmon to a cgroup, we still need to call Wait() on the process, or else we will leak a child
@@ -169,6 +169,9 @@ func (r *runtimeOCI) CreateContainer(ctx context.Context, c *Container, cgroupPa
// Platform specific container setup
if err := r.createContainerPlatform(c, cgroupParent, cmd.Process.Pid); err != nil {
+ if waitErr := cmd.Wait(); waitErr != nil {
+ return errors.Wrap(err, waitErr.Error())
+ }
return err
}
