git: add git bundle source support#6711
Merged
tonistiigi merged 2 commits intomoby:masterfrom May 4, 2026
Merged
Conversation
33f871c to
5b1949c
Compare
crazy-max
reviewed
Apr 23, 2026
crazy-max
reviewed
Apr 23, 2026
| } else { | ||
| attrs[pb.AttrMountSSHSock] = gi.MountSSHSock | ||
| } | ||
| addCap(&gi.Constraints, pb.CapSourceGitMountSSHSock) |
Member
There was a problem hiding this comment.
It still wires SSH even when GitBundleURL(...) is set? Maybe we should add an extra cond:
Suggested change
| if remote != nil && remote.Scheme == gitutil.SSHProtocol && gi.Bundle == "" { | |
| if gi.KnownSSHHosts != "" { | |
| attrs[pb.AttrKnownSSHHosts] = gi.KnownSSHHosts | |
| } else { | |
| keyscan, err := sshutil.SSHKeyScan(remote.Host) | |
| if err == nil { | |
| // best effort | |
| attrs[pb.AttrKnownSSHHosts] = keyscan | |
| } | |
| } | |
| addCap(&gi.Constraints, pb.CapSourceGitKnownSSHHosts) | |
| if gi.MountSSHSock == "" { | |
| attrs[pb.AttrMountSSHSock] = "default" | |
| } else { | |
| attrs[pb.AttrMountSSHSock] = gi.MountSSHSock | |
| } | |
| addCap(&gi.Constraints, pb.CapSourceGitMountSSHSock) |
Member
Author
There was a problem hiding this comment.
Probably sending the cap is still correct as the SSH URL is still sent and tracked. Bundle URL does not replace the identifier URL, but becomes an extra transport option on top of it.
Member
There was a problem hiding this comment.
Ah right still need to preserve source identity and SSH attrs may still be relevant later, like for submodules
Member
There was a problem hiding this comment.
Was trying to point that bundle mode can force SSH forwarding even before we have any reason to contact the SSH remote
Support importing git sources from OCI or registry-backed bundle blobs and exporting resolved checkouts as single-file git bundles. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
6cc4791 to
45e34b9
Compare
crazy-max
approved these changes
May 4, 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.
Support importing git sources from OCI or registry-backed bundle blobs and exporting resolved checkouts as single-file git bundles.