mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-09 11:10:40 +00:00
fix: set logger for controller-runtime (#1211)
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
This commit is contained in:
1
go.mod
1
go.mod
@@ -38,6 +38,7 @@ require (
|
|||||||
github.com/IBM/watsonx-go v1.0.1
|
github.com/IBM/watsonx-go v1.0.1
|
||||||
github.com/aws/aws-sdk-go v1.53.21
|
github.com/aws/aws-sdk-go v1.53.21
|
||||||
github.com/cohere-ai/cohere-go/v2 v2.7.3
|
github.com/cohere-ai/cohere-go/v2 v2.7.3
|
||||||
|
github.com/go-logr/zapr v1.3.0
|
||||||
github.com/google/generative-ai-go v0.11.0
|
github.com/google/generative-ai-go v0.11.0
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
|
||||||
github.com/hupe1980/go-huggingface v0.0.15
|
github.com/hupe1980/go-huggingface v0.0.15
|
||||||
|
@@ -25,11 +25,13 @@ import (
|
|||||||
|
|
||||||
gw "buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2/schema/v1/server-service/schemav1gateway"
|
gw "buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2/schema/v1/server-service/schemav1gateway"
|
||||||
rpc "buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go/schema/v1/schemav1grpc"
|
rpc "buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go/schema/v1/schemav1grpc"
|
||||||
|
"github.com/go-logr/zapr"
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
"golang.org/x/net/http2/h2c"
|
"golang.org/x/net/http2/h2c"
|
||||||
|
ctrl "sigs.k8s.io/controller-runtime"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
@@ -80,6 +82,8 @@ func grpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Ha
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Config) Serve() error {
|
func (s *Config) Serve() error {
|
||||||
|
ctrl.SetLogger(zapr.NewLogger(s.Logger))
|
||||||
|
|
||||||
var lis net.Listener
|
var lis net.Listener
|
||||||
var err error
|
var err error
|
||||||
address := fmt.Sprintf(":%s", s.Port)
|
address := fmt.Sprintf(":%s", s.Port)
|
||||||
|
Reference in New Issue
Block a user