mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-27 13:48:04 +08:00
controller: remove controller grpc service
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>
This commit is contained in:

committed by
Jonathan A. Sternberg

parent
2eaea647d8
commit
2f1be25b8f
@@ -2,35 +2,12 @@ package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/buildx/controller/control"
|
||||
"github.com/docker/buildx/controller/local"
|
||||
"github.com/docker/buildx/controller/remote"
|
||||
"github.com/docker/buildx/util/progress"
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func NewController(ctx context.Context, opts control.ControlOptions, dockerCli command.Cli, pw progress.Writer) (control.BuildxController, error) {
|
||||
var name string
|
||||
if opts.Detach {
|
||||
name = "remote"
|
||||
} else {
|
||||
name = "local"
|
||||
}
|
||||
|
||||
var c control.BuildxController
|
||||
err := progress.Wrap(fmt.Sprintf("[internal] connecting to %s controller", name), pw.Write, func(l progress.SubLogger) (err error) {
|
||||
if opts.Detach {
|
||||
c, err = remote.NewRemoteBuildxController(ctx, dockerCli, opts, l)
|
||||
} else {
|
||||
c = local.NewLocalBuildxController(ctx, dockerCli, l)
|
||||
}
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to start buildx controller")
|
||||
}
|
||||
return c, nil
|
||||
func NewController(ctx context.Context, dockerCli command.Cli) control.BuildxController {
|
||||
return local.NewLocalBuildxController(ctx, dockerCli)
|
||||
}
|
||||
|
Reference in New Issue
Block a user