diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-03-27 10:13:51 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-03-27 14:36:03 -0400 |
commit | 4352d585490f6c1eb7234ef4f92e0157083d69b3 (patch) | |
tree | e69b2d9487ea7623c2d04eaa848e67792e42faaa /libpod/container.go | |
parent | 2c5c1980200806d2a0dde375564b505b9150e645 (diff) | |
download | podman-4352d585490f6c1eb7234ef4f92e0157083d69b3.tar.gz podman-4352d585490f6c1eb7234ef4f92e0157083d69b3.tar.bz2 podman-4352d585490f6c1eb7234ef4f92e0157083d69b3.zip |
Add support for containers.conf
vendor in c/common config pkg for containers.conf
Signed-off-by: Qi Wang qiwan@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/container.go')
-rw-r--r-- | libpod/container.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libpod/container.go b/libpod/container.go index e59fb9fe8..c1deb95f9 100644 --- a/libpod/container.go +++ b/libpod/container.go @@ -11,6 +11,7 @@ import ( "github.com/containernetworking/cni/pkg/types" cnitypes "github.com/containernetworking/cni/pkg/types/current" + "github.com/containers/common/pkg/config" "github.com/containers/image/v5/manifest" "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/lock" @@ -1083,10 +1084,10 @@ func (c *Container) NamespacePath(linuxNS LinuxNS) (string, error) { //nolint:in // CGroupPath returns a cgroups "path" for a given container. func (c *Container) CGroupPath() (string, error) { - switch c.runtime.config.CgroupManager { - case define.CgroupfsCgroupsManager: + switch c.runtime.config.Engine.CgroupManager { + case config.CgroupfsCgroupsManager: return filepath.Join(c.config.CgroupParent, fmt.Sprintf("libpod-%s", c.ID())), nil - case define.SystemdCgroupsManager: + case config.SystemdCgroupsManager: if rootless.IsRootless() { uid := rootless.GetRootlessUID() parts := strings.SplitN(c.config.CgroupParent, "/", 2) @@ -1100,7 +1101,7 @@ func (c *Container) CGroupPath() (string, error) { } return filepath.Join(c.config.CgroupParent, createUnitName("libpod", c.ID())), nil default: - return "", errors.Wrapf(define.ErrInvalidArg, "unsupported CGroup manager %s in use", c.runtime.config.CgroupManager) + return "", errors.Wrapf(define.ErrInvalidArg, "unsupported CGroup manager %s in use", c.runtime.config.Engine.CgroupManager) } } |