mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
Migrate the Podman code base over to `common/libimage` which replaces `libpod/image` and a lot of glue code entirely. Note that I tried to leave bread crumbs for changed tests. Miscellaneous changes: * Some errors yield different messages which required to alter some tests. * I fixed some pre-existing issues in the code. Others were marked as `//TODO`s to prevent the PR from exploding. * The `NamesHistory` of an image is returned as is from the storage. Previously, we did some filtering which I think is undesirable. Instead we should return the data as stored in the storage. * Touched handlers use the ABI interfaces where possible. * Local image resolution: previously Podman would match "foo" on "myfoo". This behaviour has been changed and Podman will now only match on repository boundaries such that "foo" would match "my/foo" but not "myfoo". I consider the old behaviour to be a bug, at the very least an exotic corner case. * Futhermore, "foo:none" does *not* resolve to a local image "foo" without tag anymore. It's a hill I am (almost) willing to die on. * `image prune` prints the IDs of pruned images. Previously, in some cases, the names were printed instead. The API clearly states ID, so we should stick to it. * Compat endpoint image removal with _force_ deletes the entire not only the specified tag. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
56 lines
2.3 KiB
Diff
56 lines
2.3 KiB
Diff
From a51192239fafdb59f26c9ddaab1ca9fcac2bb664 Mon Sep 17 00:00:00 2001
|
|
From: Ed Santiago <santiago@redhat.com>
|
|
Date: Tue, 9 Feb 2021 17:28:05 -0700
|
|
Subject: [PATCH] tweaks for running buildah tests under podman
|
|
|
|
Signed-off-by: Ed Santiago <santiago@redhat.com>
|
|
---
|
|
tests/helpers.bash | 26 +++++++++++++++++++++++---
|
|
1 file changed, 23 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/tests/helpers.bash b/tests/helpers.bash
|
|
index 4dc3a7dbda13..003575f48cec 100644
|
|
--- a/tests/helpers.bash
|
|
+++ b/tests/helpers.bash
|
|
@@ -140,15 +140,35 @@ function run_buildah() {
|
|
--retry) retry=3; shift;; # retry network flakes
|
|
esac
|
|
|
|
+ local podman_or_buildah=${BUILDAH_BINARY}
|
|
+ if [[ $1 == "bud" || $1 == "build-using-dockerfile" ]]; then
|
|
+ shift
|
|
+ # podman defaults to --layers=true; buildah to --false.
|
|
+ # If command line includes explicit --layers, leave it untouched,
|
|
+ # but otherwise update command line so podman mimics buildah default.
|
|
+ if [[ "$*" =~ --layers || "$*" =~ --squash ]]; then
|
|
+ set "build" "--force-rm=false" "$@"
|
|
+ else
|
|
+ set "build" "--force-rm=false" "--layers=false" "$@"
|
|
+ fi
|
|
+ podman_or_buildah=${PODMAN_BINARY}
|
|
+
|
|
+ # podman always exits 125 where buildah exits 1 or 2
|
|
+ case $expected_rc in
|
|
+ 1|2) expected_rc=125 ;;
|
|
+ esac
|
|
+ fi
|
|
+ local cmd_basename=$(basename ${podman_or_buildah})
|
|
+
|
|
# Remember command args, for possible use in later diagnostic messages
|
|
- MOST_RECENT_BUILDAH_COMMAND="buildah $*"
|
|
+ MOST_RECENT_BUILDAH_COMMAND="$cmd_basename $*"
|
|
|
|
while [ $retry -gt 0 ]; do
|
|
retry=$(( retry - 1 ))
|
|
|
|
# stdout is only emitted upon error; this echo is to help a debugger
|
|
- echo "\$ $BUILDAH_BINARY $*"
|
|
- run timeout --foreground --kill=10 $BUILDAH_TIMEOUT ${BUILDAH_BINARY} ${REGISTRY_OPTS} ${ROOTDIR_OPTS} "$@"
|
|
+ echo "\$ $cmd_basename $*"
|
|
+ run timeout --foreground --kill=10 $BUILDAH_TIMEOUT ${podman_or_buildah} --registries-conf ${TESTSDIR}/registries.conf --root ${TESTDIR}/root --runroot ${TESTDIR}/runroot --storage-driver ${STORAGE_DRIVER} "$@"
|
|
# without "quotes", multiple lines are glommed together into one
|
|
if [ -n "$output" ]; then
|
|
echo "$output"
|
|
--
|
|
2.31.1
|