mirror of
https://github.com/openshift/openshift-mcp-server.git
synced 2025-10-17 14:27:48 +03:00
refactor(helm): rename some list function
This commit is contained in:
@@ -26,8 +26,8 @@ func NewHelm(kubernetes Kubernetes, namespace string) *Helm {
|
||||
return &Helm{kubernetes: kubernetes}
|
||||
}
|
||||
|
||||
// ReleasesList lists all the releases for the specified namespace (or current namespace if). Or allNamespaces is true, it lists all releases across all namespaces.
|
||||
func (h *Helm) ReleasesList(namespace string, allNamespaces bool) (string, error) {
|
||||
// List lists all the releases for the specified namespace (or current namespace if). Or allNamespaces is true, it lists all releases across all namespaces.
|
||||
func (h *Helm) List(namespace string, allNamespaces bool) (string, error) {
|
||||
cfg := new(action.Configuration)
|
||||
applicableNamespace := ""
|
||||
if !allNamespaces {
|
||||
|
||||
@@ -29,7 +29,7 @@ func (s *Server) helmList(_ context.Context, ctr mcp.CallToolRequest) (*mcp.Call
|
||||
if v, ok := ctr.Params.Arguments["namespace"].(string); ok {
|
||||
namespace = v
|
||||
}
|
||||
ret, err := s.k.Helm.ReleasesList(namespace, allNamespaces)
|
||||
ret, err := s.k.Helm.List(namespace, allNamespaces)
|
||||
if err != nil {
|
||||
return NewTextResult("", fmt.Errorf("failed to list helm releases in namespace '%s': %w", namespace, err)), nil
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ func TestHelmList(t *testing.T) {
|
||||
t.Fatalf("unexpected result %v", toolResult.Content[0].(mcp.TextContent).Text)
|
||||
}
|
||||
})
|
||||
_, err = kc.CoreV1().Secrets("default").Create(c.ctx, &corev1.Secret{
|
||||
_, _ = kc.CoreV1().Secrets("default").Create(c.ctx, &corev1.Secret{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "release-to-list",
|
||||
Labels: map[string]string{"owner": "helm"},
|
||||
|
||||
Reference in New Issue
Block a user