Hide infrastructure images by repository, not exact reference - #2092
Open
devops-thiago wants to merge 1 commit into
Open
Hide infrastructure images by repository, not exact reference#2092devops-thiago wants to merge 1 commit into
devops-thiago wants to merge 1 commit into
Conversation
The infra filter compared full references, so it only recognized the vminit and builder images at the version this build would pull. The vminit left behind by the previous engine version — same repository, older tag — surfaced in every image list after an upgrade, looking like something the user pulled and forgot. Nobody pulls an init or builder image on purpose. Any tag of a configured infrastructure repository is infrastructure, so the filter now also matches on the reference with its tag or digest removed. The tag colon is found after the last path separator rather than the first colon, because a registry with a port (registry.local:5000/repo) would otherwise be truncated at the port. Found by an integration test asserting vminit is never visible, against a store that still held vminit:0.35.0 beside a 0.40.1 engine — which is exactly the state every user's store will be in after their first app update.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2088.
Type of Change
Motivation and Context
Utility.isInfraImagecompares full references, so it only recognizes the vminit and builder images at the exact version the running build would pull. After any upgrade that bumps the containerization dependency, the previous version's vminit — same repository, older tag — appears incontainer image lslooking like something the user pulled and forgot. Every user who lives through such an upgrade ends up with one (evidence in #2088).Description
Nobody pulls an init or builder image deliberately: any tag of a configured infrastructure repository is infrastructure. The filter keeps the exact-reference match and additionally compares the reference with its tag or digest removed. The tag colon is located after the last path separator, so a registry with a port (
registry.local:5000/repo) is not truncated at the port;@digestsuffixes are stripped first.Testing
UtilityTestscover the exact match, the stale-tag case from [Bug]: Stale infrastructure images appear incontainer image lsafter a CLI upgrade #2088, digest references, the registry-port edge, and user images that merely share a name suffix.swift test --filter UtilityTests: 17 tests pass on this branch at abff418.vminit:0.35.0disappears fromcontainer image lswith this change and remains reachable via the infra-inclusive listing.