diff options
author | Aditya R <arajan@redhat.com> | 2022-08-23 13:12:46 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-08-23 13:39:01 +0530 |
commit | 70e103c04cdb5dd098b77a46f8030c7b0fad11b4 (patch) | |
tree | d0bc0e4b122ab95951b671f2449c0818c75b9929 /test | |
parent | d97f4dfbcc5af69c01afa2a76194486d178f63a6 (diff) | |
download | podman-70e103c04cdb5dd098b77a46f8030c7b0fad11b4.tar.gz podman-70e103c04cdb5dd098b77a46f8030c7b0fad11b4.tar.bz2 podman-70e103c04cdb5dd098b77a46f8030c7b0fad11b4.zip |
inspect, image: alias .Config.HealthCheck to .HealthCheck for compatibility
Support inspecting image healthcheck using docker supported
`.Config.HealthCheck` by aliasing field to `.HealthCheck`
Now supports
```Console
podman image inspect -f "{{.Config.Healthcheck}}" imagename
```
Closes: https://github.com/containers/podman/issues/14661
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/healthcheck_run_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/e2e/healthcheck_run_test.go b/test/e2e/healthcheck_run_test.go index fd4e763f9..969f83b19 100644 --- a/test/e2e/healthcheck_run_test.go +++ b/test/e2e/healthcheck_run_test.go @@ -317,6 +317,12 @@ HEALTHCHECK CMD ls -l / 2>&1`, ALPINE) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) + // Check if image inspect contains CMD-SHELL generated by healthcheck. + session = podmanTest.Podman([]string{"image", "inspect", "--format", "{{.Config.Healthcheck}}", "test"}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + Expect(session.OutputToString()).To(ContainSubstring("CMD-SHELL")) + run := podmanTest.Podman([]string{"run", "-dt", "--name", "hctest", "test", "ls"}) run.WaitWithDefaultTimeout() Expect(run).Should(Exit(0)) |