mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit to 2f99651
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
33
vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go
generated
vendored
33
vendor/github.com/moby/buildkit/frontend/gateway/grpcclient/client.go
generated
vendored
@ -9,10 +9,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
|
||||
"github.com/gogo/googleapis/google/rpc"
|
||||
gogotypes "github.com/gogo/protobuf/types"
|
||||
"github.com/golang/protobuf/ptypes/any"
|
||||
@ -22,7 +21,9 @@ import (
|
||||
"github.com/moby/buildkit/identity"
|
||||
opspb "github.com/moby/buildkit/solver/pb"
|
||||
"github.com/moby/buildkit/util/apicaps"
|
||||
"github.com/moby/buildkit/util/bklog"
|
||||
"github.com/moby/buildkit/util/grpcerrors"
|
||||
"github.com/moby/sys/signal"
|
||||
digest "github.com/opencontainers/go-digest"
|
||||
"github.com/pkg/errors"
|
||||
fstypes "github.com/tonistiigi/fsutil/types"
|
||||
@ -30,6 +31,7 @@ import (
|
||||
spb "google.golang.org/genproto/googleapis/rpc/status"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
@ -642,6 +644,8 @@ func debugMessage(msg *pb.ExecMessage) string {
|
||||
return fmt.Sprintf("File Message %s, fd=%d, %d bytes", msg.ProcessID, m.File.Fd, len(m.File.Data))
|
||||
case *pb.ExecMessage_Resize:
|
||||
return fmt.Sprintf("Resize Message %s", msg.ProcessID)
|
||||
case *pb.ExecMessage_Signal:
|
||||
return fmt.Sprintf("Signal Message %s: %s", msg.ProcessID, m.Signal.Name)
|
||||
case *pb.ExecMessage_Started:
|
||||
return fmt.Sprintf("Started Message %s", msg.ProcessID)
|
||||
case *pb.ExecMessage_Exit:
|
||||
@ -963,6 +967,29 @@ func (ctrProc *containerProcess) Resize(_ context.Context, size client.WinSize)
|
||||
})
|
||||
}
|
||||
|
||||
var sigToName = map[syscall.Signal]string{}
|
||||
|
||||
func init() {
|
||||
for name, value := range signal.SignalMap {
|
||||
sigToName[value] = name
|
||||
}
|
||||
}
|
||||
|
||||
func (ctrProc *containerProcess) Signal(_ context.Context, sig syscall.Signal) error {
|
||||
name := sigToName[sig]
|
||||
if name == "" {
|
||||
return errors.Errorf("unknown signal %v", sig)
|
||||
}
|
||||
return ctrProc.execMsgs.Send(&pb.ExecMessage{
|
||||
ProcessID: ctrProc.id,
|
||||
Input: &pb.ExecMessage_Signal{
|
||||
Signal: &pb.SignalMessage{
|
||||
Name: name,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
type reference struct {
|
||||
c *grpcClient
|
||||
id string
|
||||
@ -1042,7 +1069,7 @@ func grpcClientConn(ctx context.Context) (context.Context, *grpc.ClientConn, err
|
||||
return stdioConn(), nil
|
||||
})
|
||||
|
||||
cc, err := grpc.DialContext(ctx, "localhost", dialOpt, grpc.WithInsecure(), grpc.WithUnaryInterceptor(grpcerrors.UnaryClientInterceptor), grpc.WithStreamInterceptor(grpcerrors.StreamClientInterceptor))
|
||||
cc, err := grpc.DialContext(ctx, "localhost", dialOpt, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithUnaryInterceptor(grpcerrors.UnaryClientInterceptor), grpc.WithStreamInterceptor(grpcerrors.StreamClientInterceptor))
|
||||
if err != nil {
|
||||
return nil, nil, errors.Wrap(err, "failed to create grpc client")
|
||||
}
|
||||
|
Reference in New Issue
Block a user