Merge pull request #611 from mrunalp/fix_set

Fix cgroup Set when Paths are specified
This commit is contained in:
Daniel, Dao Quang Minh 2016-07-21 14:00:22 +01:00 committed by GitHub
commit ff88baa42f
2 changed files with 10 additions and 0 deletions

View File

@ -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)

View File

@ -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())