Repository navigation
Stamp img_pull images referenced by their alias labels - #304
Merged
abrisco merged 1 commit intoOct 24, 2026
Merged
Conversation
From rules_img 0.3.17, `img_pull` makes `:image` and `:final` aliases of
an `:image_import` target. Bazel resolves aliases before helm_package sees
the target, so stamps were keyed only on `:image_import` and values using
`{@repo//:image}` failed to build. The repository-name alias never stamped.
Add the alias labels `img_pull` defines as extra stamp keys, list them in
the missing-stamp error, and bump the rules_img dev dependency to 0.3.18 so
tests/with_image_deps_img covers the alias case.
rdark
marked this pull request as ready for review
October 19, 2026 15:30
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.
img_pullgives each pulled image several labels. In every version, one of them is an alias named after the repository, so@base//:base(which the shorthand@baseexpands to) points at@base//:image. Up to 0.3.16,@base//:imageis theimage_importtarget itself. From 0.3.17, the target is@base//:image_import, and@base//:imageand@base//:finalare aliases of it.Bazel resolves aliases before
helm_packagesees the target, so stamps are keyed only on the target's own label. On 0.3.17 and later that is@base//:image_import, and a values file using{@base//:image}fails withFailed to find key @@…//:image_import in content. On 0.3.9 the same values work, becauseimagewas the target itself, and{@base//:base}has never worked.This PR adds the image's alias labels as extra stamp keys:
:image,:finaland:basefrom 0.3.17, and:basebefore that. The image is matched by any of them, and the missing-stamp error lists all of them. Aliases are added only for animage_importat the root of an external repository, which is whereimg_pullwrites it.It also bumps the dev dependency on
rules_imgfrom 0.3.9 to 0.3.18, sotests/with_image_deps_imgexercises the alias case. That test now also checks:image_import,:finaland the repository-name label.Testing
bazel test //...and--config=stricton macOS with Bazel 9.3.0 and 7.7.1: 63 pass, 3 skipped. The skipped tests aretests/with_image_deps_img, which only run on Linux.tests/with_image_deps_imgforlinux_arm64and checked itsvalues_patternsby hand: 11 of 11 match on 0.3.18 (Bazel 9.3.0 and 7.7.1). Without the alias change, the:imageand repository-name patterns fail. On 0.3.9 the repository-name label now also stamps; the:image_importand:finallabels do not exist there.