mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-24 12:18:06 +08:00
bake: ensure remote files behind ssh expose agent
The updateContext function may make modifications to the build inputs, creating either an SSH URL, or an SSH llb.State. In these cases, we need to ensure that we appropriately expose the client's default agent. Previously, we would only expose it if the remote context was a git URL, however, we need to also ensure that if the input was used to override the context (in the case of ReadRemoteFiles), that we expose the agent here as well. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@@ -1105,7 +1105,7 @@ func toBuildOpt(t *Target, inp *Input) (*build.Options, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(sshSpecs) == 0 && buildflags.IsGitSSH(contextPath) {
|
||||
if len(sshSpecs) == 0 && (buildflags.IsGitSSH(bi.ContextPath) || (inp != nil && buildflags.IsGitSSH(inp.URL))) {
|
||||
sshSpecs = append(sshSpecs, &controllerapi.SSH{ID: "default"})
|
||||
}
|
||||
sshAttachment, err := controllerapi.CreateSSH(sshSpecs)
|
||||
|
Reference in New Issue
Block a user