agent/taskresource/cgroup/control/cgroup_controller_linux.go
func (c *control) Create(cgroupSpec *Spec) (cgroups.Cgroup, error) {
	// Validate incoming spec
	err := validateCgroupSpec(cgroupSpec)
	if err != nil {
		return nil, errors.Wrapf(err, "cgroup create: failed to validate spec")
	}

	// Create cgroup
	seelog.Infof("Creating cgroup %s", cgroupSpec.Root)
	controller, err := c.New(cgroups.V1, cgroups.StaticPath(cgroupSpec.Root), cgroupSpec.Specs)

	if err != nil {
		return nil, errors.Wrapf(err, "cgroup create: unable to create controller")
	}

	return controller, nil
}
func (c *control) Create(cgroupSpec *Spec) (cgroups.Cgroup, error) {
	// Validate incoming spec
	err := validateCgroupSpec(cgroupSpec)
	if err != nil {
		return nil, errors.Wrapf(err, "cgroup create: failed to validate spec")
	}

	// Create cgroup
	seelog.Infof("Creating cgroup %s", cgroupSpec.Root)
	controller, err := c.New(cgroups.V1, cgroups.StaticPath(cgroupSpec.Root), cgroupSpec.Specs)

	if err != nil {
		return nil, errors.Wrapf(err, "cgroup create: unable to create controller")
	}

	return controller, nil
}
func ( c * control ) Create ( cgroupSpec * Spec ) ( cgroups . Cgroup , error ) { // Validate incoming spec err := validateCgroupSpec ( cgroupSpec ) if err != nil { return nil , errors . Wrapf ( err , " " ) } // Create cgroup seelog . Infof ( " " , cgroupSpec . Root ) controller , err := c . New ( cgroups . V1 , cgroups . StaticPath ( cgroupSpec . Root ) , cgroupSpec . Specs ) if err != nil { return nil , errors . Wrapf ( err , " " ) } return controller , nil }
// Create creates a new cgroup based off the spec post validation
Create creates a new cgroup based off the spec post validation