Skip to content

Commit

Permalink
Merge pull request containerd#54 from WeiZhang555/bugfix
Browse files Browse the repository at this point in the history
Bugfix: can't write to cpuset cgroup
  • Loading branch information
estesp authored Sep 17, 2018
2 parents 58556f5 + 13aaafd commit 5017d4e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cpuset.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ func (c *cpusetController) Create(path string, resources *specs.LinuxResources)
if resources.CPU != nil {
for _, t := range []struct {
name string
value *string
value string
}{
{
name: "cpus",
value: &resources.CPU.Cpus,
value: resources.CPU.Cpus,
},
{
name: "mems",
value: &resources.CPU.Mems,
value: resources.CPU.Mems,
},
} {
if t.value != nil {
if t.value != "" {
if err := ioutil.WriteFile(
filepath.Join(c.Path(path), fmt.Sprintf("cpuset.%s", t.name)),
[]byte(*t.value),
[]byte(t.value),
defaultFilePerm,
); err != nil {
return err
Expand Down

0 comments on commit 5017d4e

Please sign in to comment.