From 775054343636d017d89393e6ce3de293017ec0e1 Mon Sep 17 00:00:00 2001 From: Ygal Blum Date: Sun, 3 Dec 2023 11:25:29 +0200 Subject: [PATCH 1/4] Kube Play - set ReportWriter when building an image Add test for a specific crash Update play build test to expect message in stderr Signed-off-by: Ygal Blum (cherry picked from commit a943be7e8e122e5a63059f1131fd20c761024a9b) Signed-off-by: Lokesh Mandvekar --- pkg/domain/infra/abi/play.go | 1 + test/e2e/play_build_test.go | 21 +++++++++--- test/system/252-quadlet.bats | 66 ++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 4 deletions(-) diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 9a1811bd87..ffa174d584 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -1023,6 +1023,7 @@ func (ic *ContainerEngine) getImageAndLabelInfo(ctx context.Context, cwd string, buildOpts.CommonBuildOpts = commonOpts buildOpts.Output = container.Image buildOpts.ContextDirectory = filepath.Dir(buildFile) + buildOpts.ReportWriter = writer if _, _, err := ic.Libpod.Build(ctx, *buildOpts, []string{buildFile}...); err != nil { return nil, nil, err } diff --git a/test/e2e/play_build_test.go b/test/e2e/play_build_test.go index 7e18fcb7c5..fbd9f799b2 100644 --- a/test/e2e/play_build_test.go +++ b/test/e2e/play_build_test.go @@ -12,6 +12,7 @@ import ( . "github.com/containers/podman/v4/test/utils" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gexec" ) var _ = Describe("Podman play kube with build", func() { @@ -85,7 +86,10 @@ LABEL marge=mom session := podmanTest.Podman([]string{"kube", "play", "top.yaml"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + stdErrString := session.ErrorToString() + Expect(stdErrString).To(ContainSubstring("Getting image source signatures")) + Expect(stdErrString).To(ContainSubstring("Writing manifest to image destination")) exists := podmanTest.Podman([]string{"image", "exists", "foobar"}) exists.WaitWithDefaultTimeout() @@ -122,7 +126,10 @@ LABEL marge=mom session := podmanTest.Podman([]string{"kube", "play", "top.yaml"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + stdErrString := session.ErrorToString() + Expect(stdErrString).To(ContainSubstring("Getting image source signatures")) + Expect(stdErrString).To(ContainSubstring("Writing manifest to image destination")) exists := podmanTest.Podman([]string{"image", "exists", "foobar"}) exists.WaitWithDefaultTimeout() @@ -266,7 +273,10 @@ LABEL marge=mom session := podmanTest.Podman([]string{"kube", "play", "--build", "top.yaml"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + stdErrString := session.ErrorToString() + Expect(stdErrString).To(ContainSubstring("Getting image source signatures")) + Expect(stdErrString).To(ContainSubstring("Writing manifest to image destination")) inspect := podmanTest.Podman([]string{"container", "inspect", "top_pod-foobar"}) inspect.WaitWithDefaultTimeout() @@ -351,7 +361,10 @@ echo GOT-HERE session := podmanTest.Podman([]string{"kube", "play", "echo.yaml"}) session.WaitWithDefaultTimeout() - Expect(session).Should(ExitCleanly()) + Expect(session).Should(Exit(0)) + stdErrString := session.ErrorToString() + Expect(stdErrString).To(ContainSubstring("Getting image source signatures")) + Expect(stdErrString).To(ContainSubstring("Writing manifest to image destination")) cid := "echo_pod-foobar" wait := podmanTest.Podman([]string{"wait", cid}) diff --git a/test/system/252-quadlet.bats b/test/system/252-quadlet.bats index 2b57e58edd..87ae039d4b 100644 --- a/test/system/252-quadlet.bats +++ b/test/system/252-quadlet.bats @@ -1412,4 +1412,70 @@ EOF run_podman rmi --ignore $(pause_image) } +# This test reproduces https://github.com/containers/podman/issues/20432 +# In order to reproduce the issue, the image in the FROM must no be available locally +# and must not have a tag. The first forces Pull and the second the resolution where the crash occurs +# Using a local registry does not work since kube play does not pass the autofile and tls-verify flags to the build +@test "quadlet - kube build from unavailable image with no tag" { + local quadlet_tmpdir=$PODMAN_TMPDIR/quadlets + + local untagged_image=quay.io/libpod/busybox + local built_image=test_image + local yaml_dir=$quadlet_tmpdir/$built_image + local build_dir=$yaml_dir/$built_image + + # Use the same directory for all quadlet files to make sure later steps access previous ones + mkdir -p $build_dir + + container_file_path=$build_dir/Containerfile + cat >$container_file_path << EOF +FROM $untagged_image +EOF + + # Create the YAMl file + pod_name="test_pod" + container_name="test" + yaml_source="$yaml_dir/build_$(random_string).yaml" + cat >$yaml_source < $quadlet_file < Date: Fri, 8 Dec 2023 14:25:17 +0530 Subject: [PATCH 2/4] [CI:DOCS] Update RELEASE_NOTES.md for v4.8.2 Signed-off-by: Lokesh Mandvekar --- RELEASE_NOTES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cb3b4ec4ee..a3aabe6133 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,13 @@ # Release Notes +## 4.8.2 +### Bugfixes +- Fixed a bug in the MacOS pkginstaller where Podman machine was using a different QEMU binary than the one installed using the installer, if it existed on the system ([#20808](https://github.com/containers/podman/issues/20808)). +- Fixed a bug on Windows (WSL) with the first-time install of user-mode networking when using the init command, as opposed to set ([#20921](https://github.com/containers/podman/issues/20921)). + +### Quadlet +- Fixed a bug where Kube image build failed when starting service with missing image ([#20432](https://github.com/containers/podman/issues/20432)). + ## 4.8.1 ### Bugfixes - Fixed a bug on Windows (WSL) where wsl.conf/resolv.conf was not restored when user-mode networking was disabled after being enabled ([#20625](https://github.com/containers/podman/issues/20625)). From aa546902fa1a927b3d770528565627d1395b19f3 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 11 Dec 2023 15:39:28 +0530 Subject: [PATCH 3/4] v4.8.2 Signed-off-by: Lokesh Mandvekar --- version/rawversion/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/rawversion/version.go b/version/rawversion/version.go index 50a0c894cb..b7c9f7100b 100644 --- a/version/rawversion/version.go +++ b/version/rawversion/version.go @@ -7,4 +7,4 @@ package rawversion // // NOTE: remember to bump the version at the top of the top-level README.md // file when this is bumped. -const RawVersion = "4.8.2-dev" +const RawVersion = "4.8.2" From 4aab4e3fe76efc70073d6dfa1476a78dc291b546 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Mon, 11 Dec 2023 15:39:50 +0530 Subject: [PATCH 4/4] bump release to v4.8.3-dev Signed-off-by: Lokesh Mandvekar --- version/rawversion/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/rawversion/version.go b/version/rawversion/version.go index b7c9f7100b..d7c0e77b9e 100644 --- a/version/rawversion/version.go +++ b/version/rawversion/version.go @@ -7,4 +7,4 @@ package rawversion // // NOTE: remember to bump the version at the top of the top-level README.md // file when this is bumped. -const RawVersion = "4.8.2" +const RawVersion = "4.8.3-dev"