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

Properly handle build --pull=false #5354

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Feb 22, 2024

buildah build --pull=false is documented to never pull the image, but it is currently ignored.

Fixes: containers/podman#21783

What type of PR is this?

/kind api-change
/kind bug
/kind cleanup
/kind deprecation
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake
/kind other

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

@rhatdan
Copy link
Member Author

rhatdan commented Feb 26, 2024

pullPolicy = define.PullNever
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this another value that the block that currently checks for "never" accepts?

tests/bud.bats Show resolved Hide resolved
tests/bud.bats Outdated
@@ -4473,15 +4475,15 @@ EOM
_prefetch alpine
_prefetch debian

run_buildah build --build-arg base=alpine --build-arg toolchainname=busybox --build-arg destinationpath=/tmp --pull=false $WITH_POLICY_JSON -f $BUDFILES/from-with-arg/Containerfile .
run_buildah build --build-arg base=alpine --build-arg toolchainname=busybox --build-arg destinationpath=/tmp --pull=ifmissing $WITH_POLICY_JSON -f $BUDFILES/from-with-arg/Containerfile .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one shouldn't need changing - the only referenced images are prefetched. Does it start to fail without this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It pulls busybox I believe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-spotted. If it's not using the "debian" image, might as well change it to prefetch busybox instead.

tests/bud.bats Outdated
expect_output --substring "FROM alpine"
expect_output --substring 'STEP 4/4: COPY --from=\$\{toolchainname\} \/ \$\{destinationpath\}'
run_buildah rm -a
}

@test "bud preserve rootfs for --mount=type=bind,from=" {
_prefetch alpine
run_buildah build --build-arg NONCE="$(date)" --layers --pull=false $WITH_POLICY_JSON -f Dockerfile.3 $BUDFILES/cache-stages
run_buildah build --build-arg NONCE="$(date)" --layers --pull=ifmissing $WITH_POLICY_JSON -f Dockerfile.3 $BUDFILES/cache-stages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one shouldn't need changing - the only base image is prefetched. Does it start to fail without this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a little carried away.

tests/run.bats Outdated
@@ -574,7 +574,7 @@ function configure_and_check_user() {
skip_if_no_runtime

_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
run_buildah from --quiet --pull=ifmissing $WITH_POLICY_JSON alpine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one shouldn't need changing - the named image is prefetched. Does it start to fail without this change?

tests/run.bats Outdated
@@ -583,7 +583,7 @@ function configure_and_check_user() {
skip_if_no_runtime

_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
run_buildah from --quiet --pull=ifmissing $WITH_POLICY_JSON alpine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one shouldn't need changing - the named image is prefetched. Does it start to fail without this change?

tests/run.bats Outdated
@@ -838,7 +838,7 @@ $output"
skip_if_no_runtime

_prefetch alpine
run_buildah from --quiet --pull=false $WITH_POLICY_JSON alpine
run_buildah from --quiet --pull=ifmissing $WITH_POLICY_JSON alpine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one shouldn't need changing - the named image is prefetched. Does it start to fail without this change?

@rhatdan rhatdan force-pushed the pull branch 2 times, most recently from 746d96f to 9132a62 Compare February 26, 2024 21:32
buildah build --pull=false is documented to never pull the image, but it
is currently ignored.

Fixes: containers/podman#21783

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flouthoc
Copy link
Collaborator

Restarted CI

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/hold

Copy link
Contributor

openshift-ci bot commented Feb 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, rhatdan, vrothberg

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:
  • OWNERS [flouthoc,rhatdan,vrothberg]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member Author

rhatdan commented Feb 27, 2024

/unhold

@openshift-merge-bot openshift-merge-bot bot merged commit 8436ffd into containers:main Feb 27, 2024
36 checks passed
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators May 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman build ignores existing tags, doesn't match Docker behaviour when --platform is used
4 participants