Repository navigation
fix(push): accept a registry with a path in cross-mount hints - #877
Merged
malt3 merged 1 commit intoNov 11, 2026
Merged
Conversation
A push destination may name its registry as a host followed by a path,
for example `registry = "reg.example.com/project/images"` with
`repository = "app"`. Pushes join registry and repository before parsing
them (`img push blob`, `img deploy`), so this form works there.
A cross-mount hint carries the same registry string, and `VFS.Layer`
parsed it on its own with `name.NewRegistry`, which accepts a host only.
With such a destination, every push that resolves a layer through a hint
failed before sending a request:
parsing cross-mount registry "reg.example.com/project/images":
registries must be valid RFC 3986 URI authorities
This breaks the manifest push of push at build time, where each
`img push blob` result becomes a hint, and any other push whose hint
names such a registry.
`VFS.Layer` now splits the hint's registry at the first slash, parses the
host as the registry, and puts the path in front of the repository. A
registry without a path resolves as before, including a host without a
dot and a hint with no registry.
malt3
enabled auto-merge
November 11, 2026 18:34
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 11, 2026
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.
Problem
A push destination may name its registry as a host followed by a path, for example
registry = "reg.example.com/project/images"withrepository = "app". Pushes join registry and repository before parsing them (img push blob,img deploy), so this form works there.A cross-mount hint carries the same registry string, and
VFS.Layerparsed it on its own withname.NewRegistry, which accepts a host only. With such a destination, every push that resolves a layer through a hint fails before sending a request:This breaks the manifest push of push at build time (
push_at_build_time_content=allorblobs_and_manifests), where eachimg push blobresult becomes a hint. The blob pushes of the same build succeed, so the build fails only at its last push action.Fix
VFS.Layersplits the hint's registry at the first slash, parses the host as the registry, and puts the path in front of the repository. The mount reference for the example above is registryreg.example.com, repositoryproject/images/app, which is what the destination itself parses to.A registry without a path resolves as before, including a host without a dot (
registry) and a hint with no registry. That is why the hint is not parsed withname.NewRepository(registry + "/" + repository): for those two forms it would read the first path segment differently thanname.NewRegistrydoes today.Tests
TestVFSLayerCrossMountHintRegistryFormscovers host, host and port, host without a dot, host and path, host with port and path, a trailing slash, and no registry. The three path cases fail without the fix, with the error above.TestVFSLayerRejectsInvalidCrossMountRegistrychecks that an invalid host still fails and that the error quotes the registry as written.bazel test @rules_img_tool//pkg/deployvfs/... @rules_img_tool//pkg/push/... @rules_img_tool//cmd/push/... @rules_img_tool//cmd/deploy/... @rules_img_tool//cmd/deploymetadata/...passes.img push manifestfor a one-image index with registrylocalhost:5917/proj/images, against a stub registry that logs requests. The 0.3.24 binary fails with the error above. The patched binary exits 0, mounts the layers withfrom=proj/images/<repository>, and writes both manifests and the tag.