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:
parent
6efb12f8c5
commit
597696a2f5
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Reference in New Issue