Skip to content

Commit

Permalink
feat: supporting new schema refactor (#494)
Browse files Browse the repository at this point in the history
Signed-off-by: AlexsJones <[email protected]>
  • Loading branch information
AlexsJones authored Aug 15, 2024
1 parent 57c6fa3 commit 6c01390
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions chart/operator/templates/k8sgpt-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,5 @@ status:
plural: ""
conditions: []
storedVersions: []


6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/k8sgpt-ai/k8sgpt-operator
go 1.21

require (
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.4.0-20240406062209-1cc152efbf5c.1
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240720172138-1b9bcd834f17.2
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240807134501-ea98c104104d.1
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240807134501-ea98c104104d.2
github.com/onsi/ginkgo/v2 v2.19.1
github.com/onsi/gomega v1.34.0
github.com/prometheus/client_golang v1.19.1
Expand All @@ -25,6 +25,8 @@ require (
)

require (
buf.build/gen/go/k8sgpt-ai/k8sgpt/connectrpc/go v1.16.2-20240807134501-ea98c104104d.1 // indirect
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2 v2.21.0-20240807134501-ea98c104104d.1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
buf.build/gen/go/k8sgpt-ai/k8sgpt/connectrpc/go v1.16.2-20240807134501-ea98c104104d.1 h1:hA8myZHNZ/d5R4F5sNl3auXCbTZS7d9h0i2Gx2ERrMs=
buf.build/gen/go/k8sgpt-ai/k8sgpt/connectrpc/go v1.16.2-20240807134501-ea98c104104d.1/go.mod h1:mOKqBBRmen05DAepoy/4yOEyYINzsXTWLZV54U/mbEE=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2 v2.21.0-20240807134501-ea98c104104d.1 h1:9N1IZQO0qFyb3x4HrDE8xNP0McvdVOn+5v16iN5m1P4=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc-ecosystem/gateway/v2 v2.21.0-20240807134501-ea98c104104d.1/go.mod h1:8XgN3APjjxe21HsGV4pb2cOgzItgDvhoGfOE+PTtLGU=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.4.0-20240406062209-1cc152efbf5c.1 h1:LgzSBB4q8qpgOqpTJoUKEbsDMddSuMK/ccdCuyQkOV8=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.4.0-20240406062209-1cc152efbf5c.1/go.mod h1:8O5QQzJX72VEsoGtQvjBYwA25KrvIN7unx+ahHfxPpc=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240807134501-ea98c104104d.1 h1:W/4o/wizyw9oBry0PRZFDH9i55u8MLxmODUSZHW7krU=
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20240807134501-ea98c104104d.1/go.mod h1:cJGWJGXgaTTqiPaZAuQPvkjkxQCWoAlCWte3/ZrpU8s=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.1-20240406062209-1cc152efbf5c.1/go.mod h1:qEarbrHjaZEQ5GeUH6XqSqqJMvtPwAGFpAc0nkSBzrQ=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240720172138-1b9bcd834f17.2 h1:IGBeVvzzeoEl0Ck0uxWXIUn8/my/ZeBvQEIaXCLteOc=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240720172138-1b9bcd834f17.2/go.mod h1:1wq1qVxvJkTEUQsF5/XjmhQYXYhbVoLSGhKnzS3ie54=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240807134501-ea98c104104d.2 h1:D3HPkRDfG1F4/yjNYTYkVgnh6aa1Fj14tiP5sBJ0pfA=
buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go v1.34.2-20240807134501-ea98c104104d.2/go.mod h1:1wq1qVxvJkTEUQsF5/XjmhQYXYhbVoLSGhKnzS3ie54=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func (c *Client) ProcessAnalysis(deployment v1.Deployment, config *v1alpha1.K8sGPT, allowAIRequest bool) (*common.K8sGPTReponse, error) {

client := rpc.NewServerServiceClient(c.conn)
client := rpc.NewServerAnalyzerServiceClient(c.conn)
req := &schemav1.AnalyzeRequest{
Explain: config.Spec.AI.Enabled && allowAIRequest,
Nocache: config.Spec.NoCache,
Expand Down
4 changes: 2 additions & 2 deletions pkg/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func (c *Client) AddConfig(config *v1alpha1.K8sGPT) error {
client := rpc.NewServerServiceClient(c.conn)
client := rpc.NewServerConfigServiceClient(c.conn)
req := &schemav1.AddConfigRequest{}
// If multiple caches are configured we pick S3
// which emulates the behaviour of K8sGPT cli
Expand Down Expand Up @@ -66,7 +66,7 @@ func (c *Client) AddConfig(config *v1alpha1.K8sGPT) error {
}

func (c *Client) RemoveConfig(config *v1alpha1.K8sGPT) error {
client := rpc.NewServerServiceClient(c.conn)
client := rpc.NewServerConfigServiceClient(c.conn)
req := &schemav1.RemoveConfigRequest{
Cache: &schemav1.Cache{},
Integrations: nil,
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func (c *Client) AddIntegration(config *v1alpha1.K8sGPT) error {

// Check if the integration is active already
client := rpc.NewServerServiceClient(c.conn)
client := rpc.NewServerConfigServiceClient(c.conn)
req := &schemav1.ListIntegrationsRequest{}

resp, err := client.ListIntegrations(context.Background(),
Expand Down

0 comments on commit 6c01390

Please sign in to comment.