Skip to content

kube play: fix pull policy #19805

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

Merged
merged 1 commit into from
Aug 31, 2023
Merged

Conversation

vrothberg
Copy link
Member

Use the newer pull policy only for the "latest" tag and default to using missing otherwise. This speeds up kube play as it'll skip reaching out to the registry and also fixes other side-effects described in #19801.

Fixes: #19801

Does this PR introduce a user-facing change?

Improve `podman kube play` to only pull a newer image for the "latest" tag.

@openshift-ci openshift-ci bot added release-note approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 30, 2023
@vrothberg
Copy link
Member Author

@edsantiago, PTAL at the tests.

@flouthoc
Copy link
Collaborator

@vrothberg Afaics podman CI is blocked since some images on quay.io are missing.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Minor comment from first review pass; will wait for PR to stabilize before reviewing again.

Thank you for this!

$PODMAN --debug kube play $yaml_source 2>$stderr
if [[ $status != 0 ]]; then
cat $stderr
die "kube play failed: $output"
Copy link
Member

Choose a reason for hiding this comment

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

There is no $output from running $PODMAN.

I understand your reluctance to "pollute logs", but please remember that the logs are invisible unless there's an error. If there's an error, wouldn't we want to see full logs? It seems safer to stick with run_podman IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I wasn't aware. Will change, thanks!

Use the `newer` pull policy only for the "latest" tag and default to
using `missing` otherwise.  This speeds up `kube play` as it'll skip
reaching out to the registry and also fixes other side-effects described
in containers#19801.

Fixes: containers#19801
Signed-off-by: Valentin Rothberg <[email protected]>
Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

LGTM, I think this makes perfect sense.

I cherry-picked this on my (unsubmitted) ExitCleanly() work in play_kube_test.go and am seeing far, far, far fewer failures. As in, a handful instead of dozens. Thank you!

_write_test_yaml command=true image=$local_image

run_podman --debug kube play $yaml_source
assert "$output" =~ "Pulling image $local_image \(policy\: newer\)" "pull policy is set to newhen pulling latest tag"
Copy link
Member

Choose a reason for hiding this comment

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

I could make a culturally insensitive remark here about wordstogethersmashing norms, but I won't. Oh, wait, I just did.

(Not worth re-pushing for. I kind of like it).

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 30, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, 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 [edsantiago,vrothberg]

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

@vrothberg
Copy link
Member Author

@flouthoc PTAL

@vrothberg
Copy link
Member Author

@giuseppe PTAL

@flouthoc
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 31, 2023
@openshift-merge-robot openshift-merge-robot merged commit 77fe460 into containers:main Aug 31, 2023
@vrothberg vrothberg deleted the fix-19801 branch August 31, 2023 09:18
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Nov 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube play snubs save-loaded image
5 participants