refactor(helm): rename some list function

This commit is contained in:
Marc Nuri
2025-05-12 09:50:54 +02:00
parent 8a4c392c5f
commit 0284cdce29
3 changed files with 4 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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
}

View File

@@ -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"},