Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: Smoke-test of a costly “always compute old-style IDs” approach #24419

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
??? Work around zstd:chunked images in health checks
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
mtrmac committed Dec 14, 2024
commit 86ed70c00204b2ab40ee966d4263c17d4ac0f4e0
28 changes: 27 additions & 1 deletion test/e2e/healthcheck_run_test.go
Original file line number Diff line number Diff line change
@@ -67,10 +67,23 @@ var _ = Describe("Podman healthcheck run", func() {
session := podmanTest.Podman([]string{"create", "-q", "--name", "hc", "quay.io/libpod/healthcheck:config-only", "ls"})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

inspect := podmanTest.Podman([]string{"image", "inspect", "quay.io/libpod/healthcheck:config-only", "--format", "{{.ManifestType}}"})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(ExitCleanly())
manifestType := inspect.OutputToString()

hc := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Config.Healthcheck}}", "hc"})
hc.WaitWithDefaultTimeout()
Expect(hc).Should(ExitCleanly())
Expect(hc.OutputToString()).To(Equal("{[CMD-SHELL curl -f http://localhost/ || exit 1] 0s 0s 5m0s 3s 0}"))
switch manifestType {
case "application/vnd.docker.distribution.manifest.v2+json":
Expect(hc.OutputToString()).To(Equal("{[CMD-SHELL curl -f http://localhost/ || exit 1] 0s 0s 5m0s 3s 0}"))
case "application/vnd.oci.image.manifest.v1+json": // The image was converted to OCI. This rather defeats the point of the test.
Expect(hc.OutputToString()).To(Equal("<nil>"))
default:
Fail(fmt.Sprintf("Unexpected manifest type %q", manifestType))
}
})

It("podman disable healthcheck with --health-cmd=none on valid container", func() {
@@ -113,6 +126,19 @@ var _ = Describe("Podman healthcheck run", func() {
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())

inspect := podmanTest.Podman([]string{"image", "inspect", "quay.io/libpod/badhealthcheck:latest", "--format", "{{.ManifestType}}"})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(ExitCleanly())
manifestType := inspect.OutputToString()
switch manifestType {
case "application/vnd.docker.distribution.manifest.v2+json":
// Proceed
case "application/vnd.oci.image.manifest.v1+json": // The image was converted to OCI. This rather defeats the point of the test.
Skip("Test image was converted to OCI")
default:
Fail(fmt.Sprintf("Unexpected manifest type %q", manifestType))
}

hc := podmanTest.Podman([]string{"healthcheck", "run", "hc"})
hc.WaitWithDefaultTimeout()
Expect(hc).Should(ExitWithError(1, ""))
8 changes: 8 additions & 0 deletions test/e2e/inspect_test.go
Original file line number Diff line number Diff line change
@@ -166,6 +166,14 @@ var _ = Describe("Podman inspect", func() {
session := podmanTest.Podman([]string{"inspect", "--format=json", HEALTHCHECK_IMAGE})
session.WaitWithDefaultTimeout()
imageData := session.InspectImageJSON()
switch imageData[0].ManifestType {
case "application/vnd.docker.distribution.manifest.v2+json":
// Proceed
case "application/vnd.oci.image.manifest.v1+json": // The image was converted to OCI. This rather defeats the point of the test.
Skip("Test image was converted to OCI")
default:
Fail(fmt.Sprintf("Unexpected manifest type %q", imageData[0].ManifestType))
}
Expect(imageData[0].HealthCheck.Timeout).To(BeNumerically("==", 3000000000))
Expect(imageData[0].HealthCheck.Interval).To(BeNumerically("==", 60000000000))
Expect(imageData[0].HealthCheck).To(HaveField("Test", []string{"CMD-SHELL", "curl -f http://localhost/ || exit 1"}))