Enable grpc reflection if using dev

This commit is contained in:
Abin Simon
2022-05-20 10:29:34 +05:30
parent 68bd13b891
commit ed93614e97
+6
View File
@@ -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()