Merge pull request #611 from mrunalp/fix_set
Fix cgroup Set when Paths are specified
This commit is contained in:
commit
ff88baa42f
|
@ -190,6 +190,11 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) Set(container *configs.Config) error {
|
func (m *Manager) Set(container *configs.Config) error {
|
||||||
|
// If Paths are set, then we are just joining cgroups paths
|
||||||
|
// and there is no need to set any values.
|
||||||
|
if m.Cgroups.Paths != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
for _, sys := range subsystems {
|
for _, sys := range subsystems {
|
||||||
// Generate fake cgroup data.
|
// Generate fake cgroup data.
|
||||||
d, err := getCgroupData(container.Cgroups, -1)
|
d, err := getCgroupData(container.Cgroups, -1)
|
||||||
|
|
|
@ -455,6 +455,11 @@ func (m *Manager) GetStats() (*cgroups.Stats, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) Set(container *configs.Config) error {
|
func (m *Manager) Set(container *configs.Config) error {
|
||||||
|
// If Paths are set, then we are just joining cgroups paths
|
||||||
|
// and there is no need to set any values.
|
||||||
|
if m.Cgroups.Paths != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
for _, sys := range subsystems {
|
for _, sys := range subsystems {
|
||||||
// Get the subsystem path, but don't error out for not found cgroups.
|
// Get the subsystem path, but don't error out for not found cgroups.
|
||||||
path, err := getSubsystemPath(container.Cgroups, sys.Name())
|
path, err := getSubsystemPath(container.Cgroups, sys.Name())
|
||||||
|
|
Loading…
Reference in New Issue