-
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
podman-remote build use .containerignore over .dockerignore #10913
Conversation
@edsantiago PTAL |
d9f63eb
to
3971357
Compare
Fixes: #10908 |
I don't think this solves the problem; it actually breaks in a different way. I'll update later, after f2f. |
Yes, this doesn't seem to fix anything. The fault is mine: I got lazy in writing the reproducer, and wrote something that probably didn't create the correct dockerignore file because of shell expansions. Try this for your dockerignore:
With that file, |
That seems to have done it, thanks. Passes on my laptop. New CI test run in progress |
LGTM! All dockerignore tests are now passing. (Failures are the usual stream-dropped bug, #10154) |
test/system/070-build.bats
Outdated
@@ -887,4 +887,61 @@ function teardown() { | |||
basic_teardown | |||
} | |||
|
|||
@test "podman build .dockerignore failure test " { |
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.
Could you remove the trailing whitespace from this and all the other new tests?
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.
Not sure what you mean?
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.
Could you remove the space between failure test
and the closing double-quote?
Also, still two unresolved bugs from my previous feedback; I'll repeat them
test/system/070-build.bats
Outdated
|
||
@test "podman build .containerignore and .dockerignore test " { | ||
tmpdir=$PODMAN_TMPDIR/build-test | ||
mkdir -p $subdir |
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.
I think you forgot:
subdir=$tmpdir/subdir
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.
^^
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.
Again, this one seems to have slipped
test/system/070-build.bats
Outdated
is "$output" ".*test2" "test2 should exists in the DockerfileExpected to fail" | ||
} | ||
|
||
@test "podman build .containerignore and .dockerignore test " { |
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.
Could you give this test a unique name? (It's the same as line 909)
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.
Removed since it was a duplicate of prior.
test/system/070-build.bats
Outdated
RUN ls /tmp/test/ | ||
EOF | ||
run_podman build -t build_test $tmpdir | ||
is "$output" ".*test2" "test2 should exists in the DockerfileExpected to fail" |
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.
Oops, hit Submit too soon. Also, should be 'exist' (no ess). And, I think the "Expected to fail" is a copy-paste error?
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.
Fixed
test/system/070-build.bats
Outdated
RUN ls /tmp/test/ | ||
EOF | ||
run_podman build -t build_test $tmpdir | ||
is "$output" ".*test1" "test1 should exists in the DockerfileExpected to fail" |
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.
same thing (exist, Expected to fail)
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.
Fixed
test/system/070-build.bats
Outdated
RUN ls /tmp/test/ | ||
EOF | ||
run_podman build -t build_test $tmpdir | ||
is "$output" ".*test1" "test1 should exists in the final image" "Confirm only .containerignore is used" |
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.
Too many arguments to is()
: the last one ("Confirm only...") is ignored. Could you pick one or the other between that and "test1 should exist"?
All kinds of red test unhappiness @rhatdan |
oh, you fixed them |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Looks like the podman-remote error is different:
My simpleminded workaround would be something like: expect_msg="no items matching glob"
if is_remote; then expect_msg="checking on sources under .*/subdir.*no such file or directory";fi |
$ mkdir zzz;cd zzz $ printf "FROM quay.io/libpod/testimage:20210610\nCOPY ./ ./\nCOPY subdir ./\n" >Dockerfile $ printf "*\nsubdir\n\!*/sub1*\n" >.dockerignore $ mkdir subdir; touch subdir/sub1.txt $ ../bin/podman-remote build . Should fail, but succeeds because we are not sending over the .dockerignore file to the server side. This PR will send the .dockerignore so the server side and use it. Fixes: containers#10907 Also if both .containerignore and .dockerignore in the context directory, podman-remote should prefer .containerignore and not use .dockerignore. Fixes: containers#10908 Signed-off-by: Daniel J Walsh <[email protected]>
/lgtm Thanks @rhatdan ! |
$ mkdir zzz;cd zzz
$ printf "FROM quay.io/libpod/testimage:20210610\nCOPY ./ ./\nCOPY subdir ./\n" >Dockerfile
$ printf "\nsubdir\n!/sub1*\n" >.dockerignore
$ mkdir subdir; touch subdir/sub1.txt
$ ../bin/podman-remote build .
Should fail, but succeeds because we are not sending over the
.dockerignore file to the server side. This PR will send the
.dockerignore so the server side and use it.
Fixes: #10907
Also if both .containerignore and .dockerignore in the context
directory, podman-remote should prefer .containerignore and not use
.dockerignore.
Fixes: #10908
Signed-off-by: Daniel J Walsh [email protected]