-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Properly handle podman run --pull command #7770
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
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.
Can you add tests?
I recall a couple of regressions on pull policies in the past and it seems they're turning back :(
8de348e
to
1d3b634
Compare
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.
LGTM
session.WaitWithDefaultTimeout() | ||
|
||
session = podmanTest.PodmanNoCache([]string{"rmi", "--force", "never", ALPINE}) | ||
session.WaitWithDefaultTimeout() |
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.
Did you really mean to do the rmi
twice?
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.
minor comment, but still would like an answer.
test/e2e/run_test.go
Outdated
Expect(session.ErrorToString()).ToNot(ContainSubstring("Trying to pull")) | ||
}) | ||
|
||
It("podman run container with --pull missing shoul pull image multiple times", func() { |
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.
nit
It("podman run container with --pull missing shoul pull image multiple times", func() { | |
It("podman run container with --pull missing should pull image multiple times", func() { |
tests aren't hip @rhatdan |
For some reason Apparmor tests failed. |
Fixed the tests. |
Test happy @rhatdan, but one minor nit and a question that might cause more changes to the test (or a head slap for me). |
Currently the --pull missing|always|never is ignored This PR implements this for local API. For remote we need to default to pullpolicy specified in the containers.conf file. Also fixed an issue when images were matching other images names based on prefix, causing images to always be pulled. I had named an image myfedora and when ever I pulled fedora, the system thought that it there were two images named fedora since it was checking for the name fedora as well as the prefix fedora. I changed it to check for fedora and the prefix /fedora, to prefent failures like I had. Signed-off-by: Daniel J Walsh <[email protected]>
@containers/podman-maintainers PTAL |
LGTM |
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.
LGTM
/lgtm |
I'm really confused. The following system test was written precisely to catch this: podman/test/system/030-run.bats Lines 134 to 156 in b0e70a6
As best my eye can tell, these tests (which are old and have been passing for many months) are identlcal to the ones you added -- which leads me to believe that the tests you added would have passed before your PR. Did you try running those tests without your changes, to see if they passed? And, do you remember or have a log of what was failing before your PR? |
DO NOT MERGE! This is a dummy PR for the sole purpose of running CI tests. I really need to understand why my system tests did not catch the "podman run --pull" problem addressed by containers#7770. So this commit leaves the new tests in place, but reverts the code changes. That should make these tests fail, and I will be better able to understand why my tests failed to catch it. I thought I had ginkgo working on my laptop, but running: ginkgo -trace -debug -r -focus 'with --pull' test/e2e ...only yields success. I suspect there's something deeper going on here but can only find out by running the full CI test suite. Sorry to be wasting cycles. This reverts commit 1b5853e. Signed-off-by: Ed Santiago <[email protected]>
Obscure corner case in which 'podman run --pull=never alpine' will actually pass *with no alpine image* if there's an image named "myalpine". (i.e. a substring match, not full string match). Fixed in containers#7770 but the tests that were added there do not actually test that. This adds a double-duty test for that as well as making sure that 'run --pull=never SHORTNAME' (implicit :latest) does not match our existing :YYYYMMDD image; then one more quick test to make sure that if we tag as :latest, the same --pull=never succeeds. Signed-off-by: Ed Santiago <[email protected]>
Currently the --pull missing|always|never is ignored
This PR implements this for local API. For remote we
need to default to pullpolicy specified in the containers.conf
file.
Also fixed an issue when images were matching other images names
based on prefix, causing images to always be pulled.
I had named an image myfedora and when ever I pulled fedora, the system
thought that it there were two images named fedora since it was checking
for the name fedora as well as the prefix fedora. I changed it to check
for fedora and the prefix /fedora, to prefent failures like I had.
Signed-off-by: Daniel J Walsh [email protected]