mirror of
https://github.com/paralus/paralus.git
synced 2026-05-06 00:17:19 +00:00
Enable grpc reflection if using dev
This commit is contained in:
6
main.go
6
main.go
@@ -43,6 +43,7 @@ import (
|
||||
_grpc "google.golang.org/grpc"
|
||||
"google.golang.org/grpc/health"
|
||||
"google.golang.org/grpc/health/grpc_health_v1"
|
||||
"google.golang.org/grpc/reflection"
|
||||
"gorm.io/driver/postgres"
|
||||
"gorm.io/gorm"
|
||||
"sigs.k8s.io/controller-runtime/pkg/manager/signals"
|
||||
@@ -603,6 +604,11 @@ func runRPC(wg *sync.WaitGroup, ctx context.Context) {
|
||||
_log.Fatalw("unable to create grpc server", "error", err)
|
||||
}
|
||||
|
||||
if dev {
|
||||
// Register reflection service on gRPC server.
|
||||
reflection.Register(s)
|
||||
}
|
||||
|
||||
go func() {
|
||||
defer s.GracefulStop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user