Skip to content

Commit

Permalink
remove binding
Browse files Browse the repository at this point in the history
  • Loading branch information
xuriwuyun committed Oct 25, 2023
1 parent a8c131a commit efe6cad
Show file tree
Hide file tree
Showing 19 changed files with 246 additions and 2,839 deletions.
35 changes: 11 additions & 24 deletions cmd/lorry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package main

import (
"flag"
"fmt"
"os"
"os/signal"
"strings"
Expand All @@ -35,6 +36,7 @@ import (

"github.com/apecloud/kubeblocks/lorry/dcs"
"github.com/apecloud/kubeblocks/lorry/engines/register"
"github.com/apecloud/kubeblocks/lorry/grpcserver"
"github.com/apecloud/kubeblocks/lorry/highavailability"
"github.com/apecloud/kubeblocks/lorry/httpserver"
opsregister "github.com/apecloud/kubeblocks/lorry/operations/register"
Expand All @@ -43,18 +45,8 @@ import (
viper "github.com/apecloud/kubeblocks/pkg/viperx"
)

var (
grpcPort int
)

const (
DefaultGRPCPort = 50001
)

func init() {
viper.AutomaticEnv()
viper.SetDefault(constant.KBEnvCharacterType, "custom")
flag.IntVar(&grpcPort, "grpcport", DefaultGRPCPort, "lorry grpc default port")
}

func main() {
Expand Down Expand Up @@ -103,20 +95,15 @@ func main() {
}
}

// // start grpc server for role probe
// listen, err := net.Listen("tcp", fmt.Sprintf(":%d", grpcPort))
// if err != nil {
// panic(fmt.Errorf("fatal error listen on port %d: %v", grpcPort, err))
// }

// healthServer := customgrpc.NewGRPCServer()
// server := grpc.NewServer()
// health.RegisterHealthServer(server, healthServer)

// err = server.Serve(listen)
// if err != nil {
// panic(fmt.Errorf("fatal error grpcserver serve failed: %v", err))
// }
// start grpc server for role probe
grpcServer, err := grpcserver.NewGRPCServer()
if err != nil {
panic(fmt.Errorf("fatal error grpcserver create failed: %v", err))
}
err = grpcServer.StartNonBlocking()
if err != nil {
panic(fmt.Errorf("fatal error grpcserver serve failed: %v", err))
}

// Start HTTP Server
ops := opsregister.Operations()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ require (
github.com/hashicorp/terraform-exec v0.18.0
github.com/jackc/pgx/v5 v5.4.3
github.com/jedib0t/go-pretty/v6 v6.4.6
github.com/json-iterator/go v1.1.12
github.com/k3d-io/k3d/v5 v5.6.0
github.com/kubernetes-csi/external-snapshotter/client/v3 v3.0.0
github.com/kubernetes-csi/external-snapshotter/client/v6 v6.2.0
Expand Down Expand Up @@ -265,6 +264,7 @@ require (
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/jonboulle/clockwork v0.3.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.16.6 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
Expand Down
Loading

0 comments on commit efe6cad

Please sign in to comment.