containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.36k stars 779 forks source link

Unqualified --pull was changed to a no-op #5723

Open Blzut3 opened 1 month ago

Blzut3 commented 1 month ago

Description

As of podman 5.2, the behavior of podman build --pull changed to a no-op. Per docker (and previous podman releases), when --pull is not specified images should only be pulled if missing, if it is specified then it should always pull. This can be worked around by qualifying --pull=always explicitly.

However, podman's behavior around this flag does not appear to have been changed but rather the inherited flag from buildah seems to be at fault. Specifically it looks like pull request #5583 was intended to be a documentation only change but accidentally functionally changed --pull from the docker compatible meaning of --pull=always to being a no-op with the default behavior. It seems there was a misunderstanding that --pull string[="true"] is trying to communicate that if the =true part isn't specified than true would be used not that it's the default when --pull isn't present (the value for which is at the end of the help text itself and is currently the correct value).

Reverting that change fixes the issue, but should probably read "always" instead of "true".

Of note, podman's code has had the DefValue property changed to "missing" to correct a similar documentation issue there. Not NoOptDefVal. I believe this got mirrored in buildah by the same author in changeset 5afd52f.

Steps to reproduce the issue:

  1. Create Containerfile with a FROM ... line.
  2. Run podman build -f Containerfile multiple times and note that it only pulls if missing.
  3. Add --pull to the command and note that the image is still only being pulled if missing instead of behaving like --pull=always.

Output of podman version if reporting a podman build issue:

Client:       Podman Engine
Version:      5.3.0-dev
API Version:  5.3.0-dev
Go Version:   go1.22.2
Git Commit:   a26a493f6b3eddcb30151473a8ca2f3ce7089bf3
Built:        Thu Sep  5 22:31:08 2024
OS/Arch:      linux/amd64

*Output of `cat /etc/release`:**

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Output of uname -a:

Linux AMD-1950X 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
github-actions[bot] commented 1 week ago

A friendly reminder that this issue had no activity for 30 days.