Skip to content
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

Regression: --no-pull flag is ignored #1819

Closed
lkho opened this issue Oct 31, 2023 · 1 comment · Fixed by #1830
Closed

Regression: --no-pull flag is ignored #1819

lkho opened this issue Oct 31, 2023 · 1 comment · Fixed by #1830

Comments

@lkho
Copy link

lkho commented Oct 31, 2023

Describe the bug

The global flag --no-pull / WATCHTOWER_NO_PULL is ignored, after the change: 650acde

Diff: 650acde#diff-4dfff1a11759918d8d5a2bbe79ed830bd0df61257fbdd86dafda649787b0b238R314

The client.PullImages check is removed, but the new params passed to container.IsNoPull(params), which is created here https://github.com/containrrr/watchtower/blob/887569f4534952ce5441f29a0c5b0af592bd85ab/cmd/root.go#L361C10-L371 , does not pass through the NoPull flag.

Steps to reproduce

  1. prepare a local docker daemon
  2. build an image with a latest tag e.g. abc:latest
  3. run a container with that tag with name e.g. abc-container
  4. rebuild the new image with the same tag abc:latest, make sure the hash changes
  5. run watchtower docker run --rm --network host containrrr/watchtower --host tcp://localhost:2375 --run-once --no-pull --log-level trace abc-container
  6. see logs
  7. it is still pulling from remote

Expected behavior

it works

Screenshots

No response

Environment

  • Platform: linux
  • Architecture: x64
  • Docker Version: 20.10.23

Your logs

time="2023-10-31T09:33:24Z" level=debug msg="Sleeping for a second to ensure the docker api client has been properly initialized."
time="2023-10-31T09:33:25Z" level=debug msg="Making sure everything is sane before starting"
time="2023-10-31T09:33:25Z" level=info msg="Watchtower 1.6.0"
time="2023-10-31T09:33:25Z" level=info msg="Using no notifications"
time="2023-10-31T09:33:25Z" level=info msg="Only checking containers which name matches \"abc-container\""
time="2023-10-31T09:33:25Z" level=info msg="Running a one time update."
time="2023-10-31T09:33:25Z" level=warning msg="Trace level enabled: log will include sensitive information as credentials and tokens"
time="2023-10-31T09:33:25Z" level=debug msg="Checking containers for updated images"
time="2023-10-31T09:33:25Z" level=debug msg="Retrieving running containers"
time="2023-10-31T09:33:25Z" level=debug msg="Trying to load authentication credentials." container=/abc-container image="abc:latest"
time="2023-10-31T09:33:25Z" level=debug msg="No credentials for index.docker.io found" config_file=/config.json
time="2023-10-31T09:33:25Z" level=debug msg="Got image name: abc:latest"
time="2023-10-31T09:33:25Z" level=debug msg="Checking if pull is needed" container=/abc-container image="abc:latest"
time="2023-10-31T09:33:25Z" level=debug msg="Built challenge URL" URL="https://index.docker.io/v2/"
time="2023-10-31T09:33:25Z" level=debug msg="Got response to challenge request" header="Bearer realm=\"https://auth.docker.io/token\",service=\"registry.docker.io\"" status="401 Unauthorized"
time="2023-10-31T09:33:25Z" level=debug msg="Checking challenge header content" realm="https://auth.docker.io/token" service=registry.docker.io
...
time="2023-10-31T09:33:29Z" level=debug msg="Error pulling image abc:latest, Error response from daemon: pull access denied for abc, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"
time="2023-10-31T09:33:29Z" level=info msg="Unable to update container \"/abc-container\": Error response from daemon: pull access denied for abc, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. Proceeding to next."
time="2023-10-31T09:33:29Z" level=info msg="Session done" Failed=0 Scanned=1 Updated=0 notify=no
time="2023-10-31T09:33:29Z" level=info msg="Waiting for the notification goroutine to finish" notify=no

Additional context

using containrrr/watchtower:1.5.3 has no problem

@github-actions
Copy link

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants