mirror of
https://github.com/containers/podman.git
synced 2025-05-25 11:06:18 +08:00
Export ConmonPidFile in 'podman inspect' for containers
This can help scripts provide a more meaningful message when coming across issues [1] which require the container to be re-created. [1] eg., https://github.com/containers/libpod/issues/2673 Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
This commit is contained in:
@ -93,6 +93,7 @@ func (c *Container) getContainerInspectData(size bool, driverData *inspect.Data)
|
|||||||
HostsPath: hostsPath,
|
HostsPath: hostsPath,
|
||||||
StaticDir: config.StaticDir,
|
StaticDir: config.StaticDir,
|
||||||
LogPath: config.LogPath,
|
LogPath: config.LogPath,
|
||||||
|
ConmonPidFile: config.ConmonPidFile,
|
||||||
Name: config.Name,
|
Name: config.Name,
|
||||||
Driver: driverData.Name,
|
Driver: driverData.Name,
|
||||||
MountLabel: config.MountLabel,
|
MountLabel: config.MountLabel,
|
||||||
|
@ -158,6 +158,7 @@ type ContainerInspectData struct {
|
|||||||
HostsPath string `json:"HostsPath"`
|
HostsPath string `json:"HostsPath"`
|
||||||
StaticDir string `json:"StaticDir"`
|
StaticDir string `json:"StaticDir"`
|
||||||
LogPath string `json:"LogPath"`
|
LogPath string `json:"LogPath"`
|
||||||
|
ConmonPidFile string `json:"ConmonPidFile"`
|
||||||
Name string `json:"Name"`
|
Name string `json:"Name"`
|
||||||
RestartCount int32 `json:"RestartCount"` //TODO
|
RestartCount int32 `json:"RestartCount"` //TODO
|
||||||
Driver string `json:"Driver"`
|
Driver string `json:"Driver"`
|
||||||
|
@ -66,6 +66,16 @@ var _ = Describe("Podman inspect", func() {
|
|||||||
Expect(session.ExitCode()).To(Equal(0))
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman inspect container with GO format for ConmonPidFile", func() {
|
||||||
|
SkipIfRemote()
|
||||||
|
session, ec, _ := podmanTest.RunLsContainer("test1")
|
||||||
|
Expect(ec).To(Equal(0))
|
||||||
|
|
||||||
|
session = podmanTest.Podman([]string{"inspect", "--format", "{{.ConmonPidFile}}", "test1"})
|
||||||
|
session.WaitWithDefaultTimeout()
|
||||||
|
Expect(session.ExitCode()).To(Equal(0))
|
||||||
|
})
|
||||||
|
|
||||||
It("podman inspect container with size", func() {
|
It("podman inspect container with size", func() {
|
||||||
SkipIfRemote()
|
SkipIfRemote()
|
||||||
_, ec, _ := podmanTest.RunLsContainer("")
|
_, ec, _ := podmanTest.RunLsContainer("")
|
||||||
|
Reference in New Issue
Block a user