1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 15:45:08 +01:00

Merge pull request #27993 from danishprakash/podman-buildah-vendor

vendor: update c/buildah to latest main
This commit is contained in:
Matt Heon
2026-02-04 16:02:39 -05:00
committed by GitHub
71 changed files with 1346 additions and 385 deletions

View File

@@ -279,6 +279,9 @@ skip_if_remote "compat API does not support oci-archive tags" \
skip_if_remote "http_proxy env is not sent via remote API" \
"build proxy - ADD URL"
skip_if_remote "--metadata-file not supported in remote mode" \
"bud cache by format"
###############################################################################
# BEGIN tests which are skipped due to actual podman or podman-remote bugs.
@@ -329,6 +332,12 @@ skip "FIXME: 2024-05-28 new VMs from #338" \
# 2025-04-01 FIXME wrong exit code from git related failures from #25756
skip_if_remote "FIXME: 2025-04-01 git related errors returning wrong exit code" \
"bud with ADD with git repository source"
#
# 2026-02-02 buildah's overlay-over-context-directory fails with process substitution
# FIXME: Don't use process substitution for Containerfile in buildah tests
skip "process substitution with overlay context not supported" \
"build-with-timestamp-applies-to-oci-archive" \
"build-with-timestamp-applies-to-oci-archive-with-base"
# END temporary workarounds that must be reevaluated periodically
###############################################################################

View File

@@ -1,16 +1,17 @@
From 4c30f5e698bc1d4ca498347435174a6be7232876 Mon Sep 17 00:00:00 2001
From 1ca19690f26005148482b1fbeff0aa52a67ee898 Mon Sep 17 00:00:00 2001
From: Ed Santiago <santiago@redhat.com>
Date: Thu, 6 Oct 2022 17:32:59 -0600
Subject: [PATCH] tweaks for running buildah tests under podman
Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: Danish Prakash <contact@danishpraka.sh>
---
tests/helpers.bash | 166 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 162 insertions(+), 4 deletions(-)
diff --git a/tests/helpers.bash b/tests/helpers.bash
index 5acd0a3c3..7a0721305 100644
index d08221a52759..5e9c818092cb 100644
--- a/tests/helpers.bash
+++ b/tests/helpers.bash
@@ -85,6 +85,42 @@ EOF
@@ -55,8 +56,8 @@ index 5acd0a3c3..7a0721305 100644
+ fi
}
function starthttpd() { # directory [working-directory-or-"" [certfile, keyfile]]
@@ -149,6 +185,22 @@ function teardown_tests() {
function starthttpd() { # directoryspecs [working-directory-or-"" [certfile, keyfile]]
@@ -154,6 +190,22 @@ function teardown_tests() {
stop_git_daemon
stop_registry
@@ -79,7 +80,7 @@ index 5acd0a3c3..7a0721305 100644
# Workaround for #1991 - buildah + overlayfs leaks mount points.
# Many tests leave behind /var/tmp/.../root/overlay and sub-mounts;
# let's find those and clean them up, otherwise 'rm -rf' fails.
@@ -270,7 +322,12 @@ function copy() {
@@ -275,7 +327,12 @@ function copy() {
}
function podman() {
@@ -93,7 +94,7 @@ index 5acd0a3c3..7a0721305 100644
}
# There are various scenarios where we would like to execute `tests` as rootless user, however certain commands like `buildah mount`
@@ -377,8 +434,86 @@ function run_buildah() {
@@ -382,8 +439,86 @@ function run_buildah() {
--retry) retry=3; shift;; # retry network flakes
esac
@@ -181,7 +182,7 @@ index 5acd0a3c3..7a0721305 100644
# If session is rootless and `buildah mount` is invoked, perform unshare,
# since normal user cannot mount a filesystem unless they're in a user namespace along with its own mount namespace.
@@ -392,8 +527,8 @@ function run_buildah() {
@@ -397,8 +532,8 @@ function run_buildah() {
retry=$(( retry - 1 ))
# stdout is only emitted upon error; this echo is to help a debugger
@@ -192,7 +193,7 @@ index 5acd0a3c3..7a0721305 100644
# without "quotes", multiple lines are glommed together into one
if [ -n "$output" ]; then
echo "$output"
@@ -420,6 +555,9 @@ function run_buildah() {
@@ -425,6 +560,9 @@ function run_buildah() {
false
fi
@@ -202,7 +203,7 @@ index 5acd0a3c3..7a0721305 100644
if [ -n "$expected_rc" ]; then
if [ "$status" -eq "$expected_rc" ]; then
return
@@ -757,6 +895,26 @@ function skip_if_no_unshare() {
@@ -753,6 +891,26 @@ function skip_if_no_unshare() {
fi
}
@@ -230,5 +231,5 @@ index 5acd0a3c3..7a0721305 100644
# start_git_daemon #
######################
--
2.51.0
2.51.1

View File

@@ -310,6 +310,21 @@ var _ = Describe("Podman build", func() {
Expect("sha256:" + data[0].ID).To(Equal(string(id)))
})
It("podman build basic alpine and print id to external file without prefix (--iidfile-raw)", func() {
targetFile := filepath.Join(podmanTest.TempDir, "idFileRaw")
session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicalpine", "--iidfile-raw", targetFile})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
id, _ := os.ReadFile(targetFile)
// Verify that id is correct (no sha256: prefix)
inspect := podmanTest.Podman([]string{"inspect", string(id)})
inspect.WaitWithDefaultTimeout()
data := inspect.InspectImageJSON()
Expect(data[0].ID).To(Equal(string(id)))
})
It("podman Test PATH and reserved annotation in built image", func() {
path := "/tmp:/bin:/usr/bin:/usr/sbin"
session := podmanTest.Podman([]string{
@@ -1385,4 +1400,20 @@ COPY --from=img2 /etc/alpine-release /prefix-test/container-prefix.txt`
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
})
It("podman build basic alpine and write metadata to external file", func() {
SkipIfRemote("--metadata-file is not supported in remote mode")
targetFile := filepath.Join(podmanTest.TempDir, "metadata.json")
session := podmanTest.Podman([]string{"build", "--pull-never", "build/basicalpine", "--metadata-file", targetFile})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
// Verify that metadata file exists and contains expected keys
metadata, err := os.ReadFile(targetFile)
Expect(err).ToNot(HaveOccurred())
Expect(metadata).To(ContainSubstring("containerimage.config.digest"))
Expect(metadata).To(ContainSubstring("containerimage.digest"))
Expect(metadata).To(ContainSubstring("containerimage.descriptor"))
})
})