Skip to content

Commit

Permalink
Merge pull request containers#2771 from baude/issue2765
Browse files Browse the repository at this point in the history
size is optional for container inspection
  • Loading branch information
openshift-merge-robot authored Mar 26, 2019
2 parents 60b009a + 7f2221d commit aa07901
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in the [API.md](https://github.com/containers/libpod/blob/master/API.md) file in

[func ContainerExists(name: string) int](#ContainerExists)

[func ContainerInspectData(name: string) string](#ContainerInspectData)
[func ContainerInspectData(name: string, size: bool) string](#ContainerInspectData)

[func ContainerRestore(name: string, keep: bool, tcpEstablished: bool) string](#ContainerRestore)

Expand Down Expand Up @@ -300,7 +300,7 @@ $ varlink call -m unix:/run/podman/io.podman/io.podman.ContainerExists '{"name":
### <a name="ContainerInspectData"></a>func ContainerInspectData
<div style="background-color: #E8E8E8; padding: 15px; margin: 10px; border-radius: 10px;">

method ContainerInspectData(name: [string](https://godoc.org/builtin#string)) [string](https://godoc.org/builtin#string)</div>
method ContainerInspectData(name: [string](https://godoc.org/builtin#string), size: [bool](https://godoc.org/builtin#bool)) [string](https://godoc.org/builtin#string)</div>
ContainerInspectData returns a container's inspect data in string form. This call is for
development of Podman only and generally should not be used.
### <a name="ContainerRestore"></a>func ContainerRestore
Expand Down
2 changes: 1 addition & 1 deletion cmd/podman/varlink/io.podman.varlink
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ method ContainerArtifacts(name: string, artifactName: string) -> (config: string

# ContainerInspectData returns a container's inspect data in string form. This call is for
# development of Podman only and generally should not be used.
method ContainerInspectData(name: string) -> (config: string)
method ContainerInspectData(name: string, size: bool) -> (config: string)

# ContainerStateData returns a container's state config in string form. This call is for
# development of Podman only and generally should not be used.
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapter/containers_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

// Inspect returns an inspect struct from varlink
func (c *Container) Inspect(size bool) (*inspect.ContainerInspectData, error) {
reply, err := iopodman.ContainerInspectData().Call(c.Runtime.Conn, c.ID())
reply, err := iopodman.ContainerInspectData().Call(c.Runtime.Conn, c.ID(), size)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/varlinkapi/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,12 @@ func (i *LibpodAPI) ContainerArtifacts(call iopodman.VarlinkCall, name, artifact
}

// ContainerInspectData returns the inspect data of a container in string format
func (i *LibpodAPI) ContainerInspectData(call iopodman.VarlinkCall, name string) error {
func (i *LibpodAPI) ContainerInspectData(call iopodman.VarlinkCall, name string, size bool) error {
ctr, err := i.Runtime.LookupContainer(name)
if err != nil {
return call.ReplyContainerNotFound(name, err.Error())
}
data, err := ctr.Inspect(true)
data, err := ctr.Inspect(size)
if err != nil {
return call.ReplyErrorOccurred("unable to inspect container")
}
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/healthcheck_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ var _ = Describe("Podman healthcheck run", func() {
})

It("podman healthcheck good check results in healthy even in start-period", func() {
SkipIfRootless()
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--healthcheck-start-period", "2m", "--healthcheck-retries", "2", "--healthcheck-command", "\"CMD-SHELL\" \"ls\" \"||\" \"exit\" \"1\"", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand All @@ -148,6 +149,7 @@ var _ = Describe("Podman healthcheck run", func() {
})

It("podman healthcheck single healthy result changes failed to healthy", func() {
SkipIfRootless()
session := podmanTest.Podman([]string{"run", "-dt", "--name", "hc", "--healthcheck-retries", "2", "--healthcheck-command", "\"CMD-SHELL\" \"ls\" \"/foo\" \"||\" \"exit\" \"1\"", ALPINE, "top"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
Expand Down

0 comments on commit aa07901

Please sign in to comment.