diff --git a/cmd/delete.go b/cmd/delete.go index c743cfd6..02b6a69e 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -22,7 +22,7 @@ var deleteCmd = cli.Command{ `, Flags: []cli.Flag{ cli.BoolFlag{ - Name: "force", + Name: "force", Usage: "force deletion", }, }, diff --git a/cmd/state.go b/cmd/state.go index 5e8af422..6bea4553 100644 --- a/cmd/state.go +++ b/cmd/state.go @@ -55,10 +55,11 @@ func doState(ctx *cli.Context) error { // https://github.com/opencontainers/runtime-spec/blob/v1.0.0-rc4/runtime.md#state // it means "the container process has neither exited nor executed the user-specified program" status := "stopped" + pid := 0 if c.Running() && checkHackyPreStart(c) == "started" { status = "running" + pid = c.InitPid() } - pid := 0 // bundlePath is the enclosing directory of the rootfs: // https://github.com/opencontainers/runtime-spec/blob/v1.0.0-rc4/bundle.md bundlePath := filepath.Dir(c.ConfigItem("lxc.rootfs.path")[0]) diff --git a/test/basic.bats b/test/basic.bats index e2541516..3f728486 100644 --- a/test/basic.bats +++ b/test/basic.bats @@ -12,6 +12,7 @@ function teardown() { crictl runp test/basic-pod-config.json crictl pull busybox crictl images - crictl create clowncore test/basic-container-config.json test/basic-pod-config.json - [ "$(crictl ps)" | grep clowncore ] + podid=$(crictl pods | grep nginx-sandbox | awk '{ print $1 }') + crictl create $podid test/basic-container-config.json test/basic-pod-config.json + [ "$(crictl ps -a)" | grep busybox ] }