-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add missing params for podman-remote build #9275
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -453,6 +453,45 @@ EOF | |
run_podman rmi -a --force | ||
} | ||
|
||
@test "build with copy-from referencing the base image" { | ||
skip_if_rootless "cannot mount as rootless" | ||
target=busybox-derived | ||
target_mt=busybox-mt-derived | ||
tmpdir=$PODMAN_TMPDIR/build-test | ||
mkdir -p $tmpdir | ||
containerfile1=$tmpdir/Containerfile1 | ||
cat >$containerfile1 <<EOF | ||
FROM quay.io/libpod/busybox AS build | ||
RUN rm -f /bin/paste | ||
USER 1001 | ||
COPY --from=quay.io/libpod/busybox /bin/paste /test/ | ||
EOF | ||
containerfile2=$tmpdir/Containerfile2 | ||
cat >$containerfile2 <<EOF | ||
FROM quay.io/libpod/busybox AS test | ||
RUN rm -f /bin/nl | ||
FROM quay.io/libpod/alpine AS final | ||
COPY --from=quay.io/libpod/busybox /bin/nl /test/ | ||
EOF | ||
run_podman build -t ${target} -f ${containerfile1} ${tmpdir} | ||
run_podman build --jobs 4 -t ${target} -f ${containerfile1} ${tmpdir} | ||
|
||
run_podman build -t ${target} -f ${containerfile2} ${tmpdir} | ||
run_podman build --no-cache --jobs 4 -t ${target_mt} -f ${containerfile2} ${tmpdir} | ||
|
||
# (can only test locally; podman-remote has no image mount command) | ||
if ! is_remote; then | ||
run_podman image mount ${target} | ||
root_single_job=$output | ||
|
||
run_podman image mount ${target_mt} | ||
root_multi_job=$output | ||
|
||
# Check that both the version with --jobs 1 and --jobs=N have the same number of files | ||
test $(find $root_single_job -type f | wc -l) = $(find $root_multi_job -type f | wc -l) | ||
fi | ||
} | ||
|
||
Comment on lines
+456
to
+494
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rhatdan @nalind I realize this is already merged, but I'm afraid this test is almost entirely a NOP. I've spent the last hour-plus trying to clean it up, and am forced to give up because I don't truly understand its purpose. Is it to test the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The basic idea, I believe since @nalind wrote it for Buildah, was to run the same build twice once with multiple --jobs and make sure that the output in the end was the same. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you! In that case, are lines 476-477 (the first two builds) needed? Or for that matter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nalind WDYT? Rereading the tests, I stole this from, I am now not sure what it is testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test was originally to ensure that when COPY --from was given an image name rather than a name we'd given to a build stage, that it would pull content from the unmodified image rather than a stage that was based on it, which was a bug that we'd fixed. |
||
@test "podman build --logfile test" { | ||
tmpdir=$PODMAN_TMPDIR/build-test | ||
mkdir -p $tmpdir | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we drop this commented code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets merge this. I waiting to open a PR to fix this as soon as this PR merges.