mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-17 16:37:46 +08:00

Remove the controller grpc service along with associated code related to sessions or remote controllers. Data types that are still used with complicated dependency chains have been kept in the same package for a future refactor. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
26 lines
500 B
Go
26 lines
500 B
Go
package pb
|
|
|
|
import (
|
|
"slices"
|
|
|
|
"github.com/moby/buildkit/session"
|
|
"github.com/moby/buildkit/session/sshforward/sshprovider"
|
|
)
|
|
|
|
type SSH struct {
|
|
ID string
|
|
Paths []string
|
|
}
|
|
|
|
func CreateSSH(ssh []*SSH) (session.Attachable, error) {
|
|
configs := make([]sshprovider.AgentConfig, 0, len(ssh))
|
|
for _, ssh := range ssh {
|
|
cfg := sshprovider.AgentConfig{
|
|
ID: ssh.ID,
|
|
Paths: slices.Clone(ssh.Paths),
|
|
}
|
|
configs = append(configs, cfg)
|
|
}
|
|
return sshprovider.NewSSHAgentProvider(configs)
|
|
}
|