From 597696a2f5db752f167c2fb00703fb4c854e0bba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 25 Apr 2026 00:45:44 +0000 Subject: [PATCH] Add len(args) >= 3 guards in test mock for plugin update/uninstall cases Agent-Logs-Url: https://github.com/helmfile/helmfile/sessions/ea0f5afc-d52d-473b-b759-853a8f841a26 Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com> --- pkg/app/init_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/app/init_test.go b/pkg/app/init_test.go index 63b5be45..fafd3957 100644 --- a/pkg/app/init_test.go +++ b/pkg/app/init_test.go @@ -234,11 +234,15 @@ func TestCheckHelmPlugins_UpdateFailsFallbackToReinstall(t *testing.T) { if len(args) >= 2 && args[0] == "plugin" { switch args[1] { case "update": - calledOps = append(calledOps, "update:"+args[2]) + if len(args) >= 3 { + calledOps = append(calledOps, "update:"+args[2]) + } // Simulate helm plugin update failing (as can happen with Helm 4) return nil, helmexec.ExitError{Message: "plugin update failed", Code: 1} case "uninstall": - calledOps = append(calledOps, "uninstall:"+args[2]) + if len(args) >= 3 { + calledOps = append(calledOps, "uninstall:"+args[2]) + } // Simulate successful uninstall return []byte{}, nil case "install":