diff options
author | Brent Baude <bbaude@redhat.com> | 2020-02-26 15:15:36 -0600 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-03-06 14:31:45 -0600 |
commit | 8b5e2a6297e6f6a5426551d1648278906a9d23de (patch) | |
tree | 7de8fe4102b581404dc3c012445750008a5b5495 /libpod | |
parent | a61d05f667f6ba74ed060d5938e99d9838c1763f (diff) | |
download | podman-8b5e2a6297e6f6a5426551d1648278906a9d23de.tar.gz podman-8b5e2a6297e6f6a5426551d1648278906a9d23de.tar.bz2 podman-8b5e2a6297e6f6a5426551d1648278906a9d23de.zip |
add default network for apiv2 create
during container creation, if no network is provided, we need to add a default value so the container can be later started.
use apiv2 container creation for RunTopContainer instead of an exec to the system podman. RunTopContainer now also returns the container id and an error.
added a libpod commit endpoint.
also, changed the use of the connections and bindings slightly to make it more convenient to write tests.
Fixes: 5366
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_ctr.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index de93fdce7..ba2a6b93e 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -10,6 +10,7 @@ import ( "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/libpod/events" + "github.com/containers/libpod/pkg/cgroups" "github.com/containers/libpod/pkg/rootless" "github.com/containers/storage/pkg/stringid" spec "github.com/opencontainers/runtime-spec/specs-go" @@ -438,9 +439,16 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, if err := c.ociRuntime.KillContainer(c, 9, false); err != nil { return err } - if err := c.unpause(); err != nil { + isV2, err := cgroups.IsCgroup2UnifiedMode() + if err != nil { return err } + // cgroups v1 and v2 handle signals on paused processes differently + if !isV2 { + if err := c.unpause(); err != nil { + return err + } + } // Need to update container state to make sure we know it's stopped if err := c.waitForExitFileAndSync(); err != nil { return err |