mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
Add Compat API for Update
The Docker endpoint here is kind of a nightmare - accepts a full Resources block, including a large number of scary things like devices. But it only documents (and seems to use) a small subset of those. This implements support for that subset. We can always extend things to implement more later if we have a need. Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@@ -730,6 +730,12 @@ if root; then
|
||||
eid=$(jq -r '.Id' <<<"$output")
|
||||
t POST exec/$eid/start 200 $cpu_weight_expect
|
||||
|
||||
# Now use the compat API
|
||||
echo '{ "Memory": 536870912 }' >${TMPD}/compatupdate.json
|
||||
t POST containers/updateCtr/update ${TMPD}/compatupdate.json 200
|
||||
t GET libpod/containers/updateCtr/json 200 \
|
||||
.HostConfig.Memory=536870912
|
||||
|
||||
podman rm -f updateCtr
|
||||
fi
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ var _ = Describe("Podman update", func() {
|
||||
Expect(inspect4.OutputToString()).To(Equal("536870912"))
|
||||
|
||||
exec4 := podmanTest.Podman([]string{"exec", testCtr, "cat", "/sys/fs/cgroup/memory.max"})
|
||||
exec3.WaitWithDefaultTimeout()
|
||||
exec4.WaitWithDefaultTimeout()
|
||||
Expect(exec4).Should(ExitCleanly())
|
||||
Expect(exec4.OutputToString()).Should(ContainSubstring("536870912"))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user