You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is somewhere between a bug, feature request, and just discussion... in short, it seems intuitive that a git repo remote context for build/bake should respect any Git configuration present in the context of the command, but it does not.
"Bug," sort of:
I'm specifically thinking about a url.insteadOf rule in ~/.gitconfig, such as to remap SSH Git URLs to equivalent HTTPS+auth URLs (see a gist with specifics of how this would work, e.g. for CI). It seems ideal to leverage GIT_AUTH_TOKEN/BUILDX_BAKE_GIT_AUTH_TOKEN in such cases, but the missing piece is support for handling the same remote context URL in SSH-authenticated environments and HTTP-authenticated environments, by those environments' configurations.
I'm using this as a workaround (again see gist for more), but feel a bit gross about it: sed -i "s|[email protected]:|https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/|" [bake file]
"Feature request," sort of:
While the case I outlined above is focused on the url.insteadOf case, I could imagine others where the host git config would be useful (maybe core.sshCommand). The ideal feature here IMO would leverage any present git config as any standalone git client would whenever resolving a git repo remote build context.
Perhaps it would just be necessary to leverage git_cli as part of relevant functions like ParseGitRef?
"Discussion," sort of:
On the other hand, the dir URL fragment syntax means that git remote build contexts aren't exactly like normal git URLs, so maybe it would add confusion to even leverage git config rules? Cases like this could be easier, but other, stranger unexpected behaviors could arise. Instead, maybe just a bit of docs clarification should specify how these URLs are handled (i.e. not quite like equivalent git clones), to save folks from going down this rabbit hole?
The text was updated successfully, but these errors were encountered:
Description
This is somewhere between a bug, feature request, and just discussion... in short, it seems intuitive that a git repo remote context for
build
/bake
should respect any Git configuration present in the context of the command, but it does not."Bug," sort of:
I'm specifically thinking about a
url.insteadOf
rule in~/.gitconfig
, such as to remap SSH Git URLs to equivalent HTTPS+auth URLs (see a gist with specifics of how this would work, e.g. for CI). It seems ideal to leverageGIT_AUTH_TOKEN
/BUILDX_BAKE_GIT_AUTH_TOKEN
in such cases, but the missing piece is support for handling the same remote context URL in SSH-authenticated environments and HTTP-authenticated environments, by those environments' configurations.I'm using this as a workaround (again see gist for more), but feel a bit gross about it:
sed -i "s|[email protected]:|https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/|" [bake file]
"Feature request," sort of:
While the case I outlined above is focused on the
url.insteadOf
case, I could imagine others where the host git config would be useful (maybecore.sshCommand
). The ideal feature here IMO would leverage any present git config as any standalone git client would whenever resolving a git repo remote build context.Perhaps it would just be necessary to leverage
git_cli
as part of relevant functions likeParseGitRef
?"Discussion," sort of:
On the other hand, the
dir
URL fragment syntax means that git remote build contexts aren't exactly like normal git URLs, so maybe it would add confusion to even leverage git config rules? Cases like this could be easier, but other, stranger unexpected behaviors could arise. Instead, maybe just a bit of docs clarification should specify how these URLs are handled (i.e. not quite like equivalentgit clone
s), to save folks from going down this rabbit hole?The text was updated successfully, but these errors were encountered: