Repository navigation
Fix distroless test helper using the wrong registry for the full runtime-deps image - #7496
Merged
Merged
Conversation
BuildDistrolessHelper resolved the runtime-deps image name (including the registry) using the distroless tag, then stripped -distroless/-chiseled from the result. When a build only produced the distroless image, this pointed at the staging registry for a full image that was never pushed. Resolve the name using the distro-full OS so the registry falls back to MCR when the full image isn't part of the build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
mthalman
approved these changes
Nov 13, 2026
lbussell
enabled auto-merge (squash)
November 13, 2026 18:43
Member
Author
|
/backport to main |
Contributor
|
Started backporting to |
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.
The distroless image tests fail whenever a build includes a distroless image but not its full runtime-deps parent. This happens because distroless and full images are built on different base images that can update independently. This bug was dormant until Azure Linux 4 started updating distroless images more independently from the full base images. The tests fail with:
In the tests,
BuildDistrolessHelperneeds the full runtime-deps image as the base for its helper image. It got that name in the wrong order:runtime-deps:11.0-azurelinux4.0-distroless-amd64.GetImagepicks the registry in that same step, by checking whether that exact tag is in this build's image info. The distroless image was built, so it chose the staging registry.-distrolessfrom the resulting string.The tag now pointed at the full image, but in the staging repo instead of from
mcr.microsoft.com. That choice was only valid for the distroless image. If the full image wasn't rebuilt in the same build, it was never pushed to staging, and the tests failed. It only worked when the full image happened to be rebuilt too.This PR resolves the image name using the full OS (
IsDistroless = false) from the start, so the registry check looks at the full image's own tag. When the full image isn't part of the build, the existing fallback uses the published image onmcr.microsoft.com, which is fine because the full image is only used to provide a shell for inspecting the copied distroless filesystem. When the full image is part of the build, staging is still used. This also covers Ubuntu chiseled images and the nightly repo.