vendor: update buildkit to a243ce438aee
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -25,10 +25,10 @@ func getSalt() []byte {
|
||||
return salt
|
||||
}
|
||||
|
||||
func CredentialsFunc(sm *session.Manager, g session.Group) func(string) (session, username, secret string, err error) {
|
||||
func CredentialsFunc(ctx context.Context, sm *session.Manager, g session.Group) func(string) (session, username, secret string, err error) {
|
||||
return func(host string) (string, string, string, error) {
|
||||
var sessionID, user, secret string
|
||||
err := sm.Any(context.TODO(), g, func(ctx context.Context, id string, c session.Caller) error {
|
||||
err := sm.Any(ctx, g, func(ctx context.Context, id string, c session.Caller) error {
|
||||
client := NewAuthClient(c.Conn())
|
||||
|
||||
resp, err := client.Credentials(ctx, &CredentialsRequest{
|
||||
|
||||
+34
-5
@@ -27,6 +27,7 @@ type GitCLI struct {
|
||||
|
||||
sshAuthSock string
|
||||
sshKnownHosts string
|
||||
hostGitConfig bool
|
||||
}
|
||||
|
||||
// Option provides a variadic option for configuring the git client.
|
||||
@@ -97,6 +98,15 @@ func WithSSHKnownHosts(sshKnownHosts string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithHostGitConfig allows git to read the host system and user git config.
|
||||
// This is intended for client-side local git inspection. The default remains
|
||||
// isolated so daemon-side callers do not leak host configuration into git.
|
||||
func WithHostGitConfig() Option {
|
||||
return func(b *GitCLI) {
|
||||
b.hostGitConfig = true
|
||||
}
|
||||
}
|
||||
|
||||
type StreamFunc func(context.Context) (io.WriteCloser, io.WriteCloser, func())
|
||||
|
||||
// WithStreams configures a callback for getting the streams for a command. The
|
||||
@@ -108,7 +118,7 @@ func WithStreams(streams StreamFunc) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// New initializes a new git client
|
||||
// NewGitCLI initializes a new git client
|
||||
func NewGitCLI(opts ...Option) *GitCLI {
|
||||
c := &GitCLI{}
|
||||
for _, opt := range opts {
|
||||
@@ -191,9 +201,28 @@ func (cli *GitCLI) Run(ctx context.Context, args ...string) (_ []byte, err error
|
||||
"GIT_TERMINAL_PROMPT=0",
|
||||
"GIT_SSH_COMMAND=" + getGitSSHCommand(cli.sshKnownHosts),
|
||||
// "GIT_TRACE=1",
|
||||
"GIT_CONFIG_NOSYSTEM=1", // Disable reading from system gitconfig.
|
||||
"HOME=/dev/null", // Disable reading from user gitconfig.
|
||||
"LC_ALL=C", // Ensure consistent output.
|
||||
"LC_ALL=C", // Ensure consistent output.
|
||||
}
|
||||
if cli.hostGitConfig {
|
||||
for _, ev := range [...]string{
|
||||
"HOME",
|
||||
"XDG_CONFIG_HOME",
|
||||
"USERPROFILE",
|
||||
"HOMEDRIVE",
|
||||
"HOMEPATH",
|
||||
"GIT_CONFIG_GLOBAL",
|
||||
"GIT_CONFIG_SYSTEM",
|
||||
} {
|
||||
if v, ok := os.LookupEnv(ev); ok {
|
||||
cmd.Env = append(cmd.Env, ev+"="+v)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cmd.Env = append(cmd.Env,
|
||||
"GIT_CONFIG_NOSYSTEM=1", // Disable reading from system gitconfig.
|
||||
"HOME="+os.DevNull, // Disable reading from user gitconfig.
|
||||
"GIT_CONFIG_GLOBAL="+os.DevNull, // Disable reading from global gitconfig.
|
||||
)
|
||||
}
|
||||
for _, ev := range proxyEnvVars {
|
||||
if v, ok := os.LookupEnv(ev); ok {
|
||||
@@ -244,7 +273,7 @@ func (cli *GitCLI) Run(ctx context.Context, args ...string) (_ []byte, err error
|
||||
}
|
||||
|
||||
func getGitSSHCommand(knownHosts string) string {
|
||||
gitSSHCommand := "ssh -F /dev/null"
|
||||
gitSSHCommand := "ssh -F " + os.DevNull
|
||||
if knownHosts != "" {
|
||||
gitSSHCommand += " -o UserKnownHostsFile=" + knownHosts
|
||||
} else {
|
||||
|
||||
Vendored
+1
-1
@@ -646,7 +646,7 @@ github.com/mitchellh/go-wordwrap
|
||||
# github.com/mitchellh/hashstructure/v2 v2.0.2
|
||||
## explicit; go 1.14
|
||||
github.com/mitchellh/hashstructure/v2
|
||||
# github.com/moby/buildkit v0.29.0
|
||||
# github.com/moby/buildkit v0.29.1-0.20260408185135-a243ce438aee
|
||||
## explicit; go 1.25.5
|
||||
github.com/moby/buildkit/api/services/control
|
||||
github.com/moby/buildkit/api/types
|
||||
|
||||
Reference in New Issue
Block a user