Skip to content

Commit

Permalink
build: pass down the cgroup manager to buildah
Browse files Browse the repository at this point in the history
Pass down the cgroup manager to use to buildah.

Closes: containers#3938

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Sep 6, 2019
1 parent 30cbb00 commit 06f94be
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/podman/build.go
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/containers/buildah/imagebuildah"
buildahcli "github.com/containers/buildah/pkg/cli"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/adapter"
"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"
Expand Down Expand Up @@ -225,6 +226,14 @@ func buildCmd(c *cliconfig.BuildValues) error {
for _, arg := range c.RuntimeFlags {
runtimeFlags = append(runtimeFlags, "--"+arg)
}

conf, err := runtime.GetConfig()
if err != nil {
return err
}
if conf != nil && conf.CgroupManager == libpod.SystemdCgroupsManager {
runtimeFlags = append(runtimeFlags, "--systemd-cgroup")
}
// end from buildah

defer runtime.DeferredShutdown(false)
Expand Down
12 changes: 12 additions & 0 deletions pkg/adapter/runtime_remote.go
Expand Up @@ -113,6 +113,18 @@ func (r RemoteRuntime) DeferredShutdown(force bool) {
}
}

// RuntimeConfig is a bogus wrapper for compat with the libpod runtime
type RuntimeConfig struct {
// CGroupManager is the CGroup Manager to use
// Valid values are "cgroupfs" and "systemd"
CgroupManager string
}

// Shutdown is a bogus wrapper for compat with the libpod runtime
func (r *RemoteRuntime) GetConfig() (*RuntimeConfig, error) {
return nil, nil
}

// Shutdown is a bogus wrapper for compat with the libpod runtime
func (r RemoteRuntime) Shutdown(force bool) error {
return nil
Expand Down

0 comments on commit 06f94be

Please sign in to comment.