From 8e37369e5c6c96096b66179f22a27b2c0018c43a Mon Sep 17 00:00:00 2001 From: R0CKSTAR Date: Thu, 8 Aug 2024 14:10:49 +0800 Subject: [PATCH 1/2] fix: set logger for controller-runtime (#1211) Signed-off-by: Xiaodong Ye --- go.mod | 1 + pkg/server/server.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/go.mod b/go.mod index 0cf3245d3d..74a9039548 100644 --- a/go.mod +++ b/go.mod @@ -38,6 +38,7 @@ require ( github.com/IBM/watsonx-go v1.0.1 github.com/aws/aws-sdk-go v1.53.21 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/grpc-ecosystem/grpc-gateway/v2 v2.20.0 github.com/hupe1980/go-huggingface v0.0.15 diff --git a/pkg/server/server.go b/pkg/server/server.go index afec3600a3..0ec900c92d 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -25,11 +25,13 @@ import ( 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" + "github.com/go-logr/zapr" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/prometheus/client_golang/prometheus/promhttp" "go.uber.org/zap" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" + ctrl "sigs.k8s.io/controller-runtime" "google.golang.org/grpc" "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 { + ctrl.SetLogger(zapr.NewLogger(s.Logger)) + var lis net.Listener var err error address := fmt.Sprintf(":%s", s.Port) From b2b86826e55984c2b6aed6554869d7ce66a5f854 Mon Sep 17 00:00:00 2001 From: Bo Wong Date: Thu, 8 Aug 2024 17:34:22 +0800 Subject: [PATCH 2/2] docs: update "CLI Installation" section in README.md (#1126) (#1127) Signed-off-by: Bo Wang Signed-off-by: Alex Jones Co-authored-by: Alex Jones --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c5e6ad96ee..58a715afc8 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,7 @@ brew install k8sgpt **32 bit:** ``` - curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_386.rpm - sudo rpm -ivh k8sgpt_386.rpm + sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_386.rpm ``` @@ -56,8 +55,7 @@ brew install k8sgpt ``` - curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_amd64.rpm - sudo rpm -ivh -i k8sgpt_amd64.rpm + sudo rpm -ivh https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_amd64.rpm ``` @@ -89,17 +87,17 @@ brew install k8sgpt **32 bit:** ``` - curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_386.apk - apk add k8sgpt_386.apk + wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_386.apk + apk add --allow-untrusted k8sgpt_386.apk ``` **64 bit:** ``` - curl -LO https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_amd64.apk - apk add k8sgpt_amd64.apk + wget https://github.com/k8sgpt-ai/k8sgpt/releases/download/v0.3.40/k8sgpt_amd64.apk + apk add --allow-untrusted k8sgpt_amd64.apk ``` - x +