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

fix: intermediate images should not be labelled #3413

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mzihlmann
Copy link

Labelling intermediate images can cause unecessary cache misses.

Description

Let's assume a label like so:

--label commit=${CI_COMMIT_SHA}

This will cause the intermediate image to be labelled with the sha. The digest of the intermediate image is used in computing the cache key for other images in the same multi-stage build. If now we run the same builds on another commit, the intermediate image emitted with new labels, which is not a problem per-se, but cache is now entirely invalid and can't be reused. As we don't intend on storing intermediate images anyways, there is no point in attaching labels to them.

With this change we skip labelling intermediate images, avoiding unecessary cache misses in certain multi-stage scenarios.

As a workaround we can also avoid labelling the image.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

  • avoid multi-stage cache misses caused by labels on intermediate images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant