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>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-25 00:45:44 +00:00 committed by GitHub
parent 6efb12f8c5
commit 597696a2f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -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":