mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-11-03 09:40:55 +08:00
hotfix: fix print grpc msg bug (#395)
This commit is contained in:
@@ -330,15 +330,6 @@ func (option *Options) Dev(ctx context.Context, cConfig *Config, hostConfig *Hos
|
|||||||
return configList.Run(ctx, volume, option.cli, option.dockerCli)
|
return configList.Run(ctx, volume, option.cli, option.dockerCli)
|
||||||
}
|
}
|
||||||
|
|
||||||
func disconnect(ctx context.Context, daemonClient rpc.DaemonClient, req *rpc.DisconnectRequest) error {
|
|
||||||
resp, err := daemonClient.Disconnect(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = util.PrintGRPCStream[rpc.DisconnectResponse](resp)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (option *Options) CreateConnectContainer(portBindings nat.PortMap) (*RunConfig, error) {
|
func (option *Options) CreateConnectContainer(portBindings nat.PortMap) (*RunConfig, error) {
|
||||||
portMap, portSet, err := option.GetExposePort(portBindings)
|
portMap, portSet, err := option.GetExposePort(portBindings)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
|
||||||
"google.golang.org/grpc/status"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Printable interface {
|
type Printable interface {
|
||||||
@@ -29,9 +27,6 @@ func PrintGRPCStream[T any](clientStream grpc.ClientStream, writers ...io.Writer
|
|||||||
if errors.Is(err, io.EOF) {
|
if errors.Is(err, io.EOF) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if status.Code(err) == codes.Canceled {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user