mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 00:15:43 +03:00
23 lines
489 B
Go
23 lines
489 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
//go:build linux
|
|
|
|
package docker
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/opencontainers/runc/libcontainer/cgroups"
|
|
)
|
|
|
|
func setCPUSetCgroup(path string, pid int) error {
|
|
// Sometimes the container exits before we can write the
|
|
// cgroup resulting in an error which can be ignored.
|
|
err := cgroups.WriteCgroupProc(path, pid)
|
|
if err != nil && strings.Contains(err.Error(), "no such process") {
|
|
return nil
|
|
}
|
|
return err
|
|
}
|