Use --pull-policy if-not-present
with Pack CLI in libcnb-test
#306
Labels
--pull-policy if-not-present
with Pack CLI in libcnb-test
#306
By default (if the global config hasn't been updated), Pack CLI will attempt to pull the builder image every time a
pack build
is performed. Even if this image is up to date, it still:pack build
timeThis is not ideal when running
pack build
multiple times in a short period of time - as happens when runninglibcnb-test
.Currently to prevent around this in CI, we enable the
if-not-present
pull policy via Pack global config:https://github.com/Malax/libcnb.rs/blob/552edb954cfc069814141baf4945921edb4e7a47/.github/workflows/ci.yml#L75-L80
However:
One way to avoid both of these issues, would be if
libcnb-test
were to pass--pull-policy if-not-present
topack build
as part of running the integration tests.One downside to doing that, would be that if a user runs
libcnb-test
powered integration tests on a machine that has old builder images, then they would never get updated unless the user is also runningpack build
outside of integration tests too. However (a) users will presumably be runningpack build
reasonably often, (b) if there are any builder image changes that cause issues then CI would catch it anyway (since it will be pulling in new images each time, since none will be present).Ideally Pack CLI would support an
if-not-pulled-recently
option, which would skip pulling if that builder image was pulled recently - and so give the best of both worlds. However in lieu of havingif-not-pulled-recently
(we should file an issue), I thinklibcnb-test
should pass--pull-policy if-not-present
to Pack for now, as it's the least worst of the two approaches.The text was updated successfully, but these errors were encountered: