mirror of https://github.com/containers/podman.git
Merge pull request #7918 from zhangguanzhang/apiv2-wrong-StopSignal
[apiv2] /containers/$name/json return wrong value in `.Config.StopSignal`
This commit is contained in:
commit
defb754945
|
@ -4,6 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -385,7 +386,7 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
|
||||||
MacAddress: "",
|
MacAddress: "",
|
||||||
OnBuild: nil,
|
OnBuild: nil,
|
||||||
Labels: l.Labels(),
|
Labels: l.Labels(),
|
||||||
StopSignal: string(l.StopSignal()),
|
StopSignal: strconv.Itoa(int(l.StopSignal())),
|
||||||
StopTimeout: &stopTimeout,
|
StopTimeout: &stopTimeout,
|
||||||
Shell: nil,
|
Shell: nil,
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,12 +216,14 @@ t GET containers/$cid/json 200 \
|
||||||
.Config.WorkingDir="/data" # default is /data
|
.Config.WorkingDir="/data" # default is /data
|
||||||
t DELETE containers/$cid 204
|
t DELETE containers/$cid 204
|
||||||
|
|
||||||
# test the WORKDIR
|
# test the WORKDIR and StopSignal
|
||||||
t POST containers/create '"Image":"'$ENV_WORKDIR_IMG'","WorkingDir":"/dataDir"' 201 \
|
t POST containers/create '"Image":"'$ENV_WORKDIR_IMG'","WorkingDir":"/dataDir","StopSignal":"9"' 201 \
|
||||||
.Id~[0-9a-f]\\{64\\}
|
.Id~[0-9a-f]\\{64\\}
|
||||||
cid=$(jq -r '.Id' <<<"$output")
|
cid=$(jq -r '.Id' <<<"$output")
|
||||||
t GET containers/$cid/json 200 \
|
t GET containers/$cid/json 200 \
|
||||||
.Config.WorkingDir="/dataDir"
|
.Config.WorkingDir="/dataDir" \
|
||||||
|
.Config.StopSignal="9"
|
||||||
|
|
||||||
t DELETE containers/$cid 204
|
t DELETE containers/$cid 204
|
||||||
|
|
||||||
# vim: filetype=sh
|
# vim: filetype=sh
|
||||||
|
|
Loading…
Reference in New Issue