summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 2ff4bfe08..dd47b4d12 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -16,6 +16,7 @@ import (
"github.com/containers/podman/v4/libpod/events"
"github.com/containers/podman/v4/pkg/signal"
"github.com/containers/storage/pkg/archive"
+ spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
)
@@ -98,6 +99,15 @@ func (c *Container) Start(ctx context.Context, recursive bool) error {
return c.start()
}
+// Update updates the given container.
+// only the cgroup config can be updated and therefore only a linux resource spec is passed.
+func (c *Container) Update(res *spec.LinuxResources) error {
+ if err := c.syncContainer(); err != nil {
+ return err
+ }
+ return c.update(res)
+}
+
// StartAndAttach starts a container and attaches to it.
// This acts as a combination of the Start and Attach APIs, ensuring proper
// ordering of the two such that no output from the container is lost (e.g. the
@@ -674,7 +684,7 @@ func (c *Container) Cleanup(ctx context.Context) error {
// When the container has already been removed, the OCI runtime directory remain.
if errors.Is(err, define.ErrNoSuchCtr) || errors.Is(err, define.ErrCtrRemoved) {
if err := c.cleanupRuntime(ctx); err != nil {
- return fmt.Errorf("error cleaning up container %s from OCI runtime: %w", c.ID(), err)
+ return fmt.Errorf("cleaning up container %s from OCI runtime: %w", c.ID(), err)
}
return nil
}