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

libimage: pull: do not enforce pull if local image matches #1287

Merged

Conversation

vrothberg
Copy link
Member

@vrothberg vrothberg commented Jan 11, 2023

I verified that the test fails without the code changes.

Fixes: github.com/containers/podman/issues/17063
Signed-off-by: Valentin Rothberg [email protected]

@rhatdan PTAL

I verified that the test fails without the code changes.

Fixes: podman/issues/17063
Signed-off-by: Valentin Rothberg <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:

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

rhatdan commented Jan 11, 2023

LGTM
@containers/podman-maintainers PTAL

// correct image.
//
// NOTE that this is will even override --pull={false,never}.
pullPolicy = config.PullPolicyNewer
logrus.Debugf("Enforcing pull policy to %q to pull custom platform (arch: %q, os: %q, variant: %q) - local image may mistakenly specify wrong platform", pullPolicy, options.Architecture, options.OS, options.Variant)
localImageMatches := false
Copy link
Member

Choose a reason for hiding this comment

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

Is the comment at line 507 correct? Just to be sure, --pull=never, should NEVER be overridden. If it is specified, we should not pull an image, we should only use the local image. It does look like we don't get in here on pull=never, and I'm hoping the comment is just off....

Copy link
Member Author

Choose a reason for hiding this comment

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

The comment is off. The condition above includes pullPolicy != config.PullPolicyNever.

I plan on massaging/simplifying this code in the future where I can cleanup comments as well.

@vrothberg
Copy link
Member Author

Merge me

@Luap99
Copy link
Member

Luap99 commented Jan 12, 2023

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jan 12, 2023
@openshift-merge-robot openshift-merge-robot merged commit 8cd08e5 into containers:main Jan 12, 2023
@vrothberg vrothberg deleted the fix-podman/issues/17063 branch January 12, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants