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

Add try-always pull policy and unit tests #2347

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kunalvirwal
Copy link

Summary

This PR adds a new pull-policy called try-always.
This policy first checks if an image is present in the remote registry and pulls it if available. If the image is not available on remote then it falls back to the local and looks for the image with the daemon.
The try-always pull-policy follows a behaviour opposite to if-not-present as it checks the remote first and then checks the local.

Output

Before

  • If we used the pull-policy of always and the image was not there on remote then pack would give an error.
  • If we used the pull-policy of if-not-present then it would only pull if we didn't have it locally.

After

  • Now using try-always we can have a custom image locally and still pull a fresh new image from the remote.
  • If the image is not found on remote then instead of giving error it will fall back to using the locally available image.

Documentation

  • Should this change be documented?
    • Yes
    • No

Related

Resolves #2201

@github-actions github-actions bot added this to the 0.37.0 milestone Mar 3, 2025
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Mar 3, 2025
@jjbustamante jjbustamante modified the milestones: 0.37.0, 0.38.0 Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pack should have a pull policy of "try always"
2 participants