-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lists activate integrations (#669)
Signed-off-by: Alex Jones <[email protected]>
- Loading branch information
1 parent
d6b7b81
commit 844ff1f
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package server | ||
|
||
import ( | ||
"context" | ||
|
||
schemav1 "buf.build/gen/go/k8sgpt-ai/k8sgpt/protocolbuffers/go/schema/v1" | ||
"github.com/k8sgpt-ai/k8sgpt/pkg/integration" | ||
) | ||
|
||
func (*handler) ListIntegrations(ctx context.Context, req *schemav1.ListIntegrationsRequest) (*schemav1.ListIntegrationsResponse, error) { | ||
|
||
integrationProvider := integration.NewIntegration() | ||
integrations := integrationProvider.List() | ||
resp := &schemav1.ListIntegrationsResponse{ | ||
Integrations: make([]string, 0), | ||
} | ||
for _, i := range integrations { | ||
b, _ := integrationProvider.IsActivate(i) | ||
if b { | ||
resp.Integrations = append(resp.Integrations, i) | ||
} | ||
} | ||
return resp, nil | ||
} |