Skip to content

Add try-always pull policy and unit tests#2347

Draft
kunalvirwal wants to merge 2 commits intobuildpacks:mainfrom
kunalvirwal:kunalvirwal/add-new-try-always-pull-policy
Draft

Add try-always pull policy and unit tests#2347
kunalvirwal wants to merge 2 commits intobuildpacks:mainfrom
kunalvirwal:kunalvirwal/add-new-try-always-pull-policy

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

Signed-off-by: kunalvirwal <kunalvirwal@gmail.com>
@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
Signed-off-by: Kunal Virwal <149074679+kunalvirwal@users.noreply.github.com>
@jjbustamante jjbustamante modified the milestones: 0.37.0, 0.38.0 Mar 5, 2025
@jjbustamante jjbustamante modified the milestones: 0.38.0, 0.39.0 Jun 3, 2025
@jjbustamante jjbustamante modified the milestones: 0.39.0, 0.40.0 Nov 23, 2025
@jjbustamante jjbustamante modified the milestones: 0.40.0, 0.41.0 Feb 3, 2026
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