Make helmfile respect signals send by kill command (not only Ctrl+C in terminal) (#750)

Fixes #746 

Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
Dmitry Chepurovskiy
2023-04-29 15:25:29 +09:00
committed by GitHub
co-authored by yxxhero
parent 3d0f0afe3a
commit aa5be82834
8 changed files with 64 additions and 18 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ package helmexec
import (
"bytes"
"context"
"os/exec"
"reflect"
"strings"
@@ -32,6 +33,7 @@ func TestShellRunner_Execute(t *testing.T) {
var buffer bytes.Buffer
shell := ShellRunner{
Logger: NewLogger(&buffer, "debug"),
Ctx: context.TODO(),
}
got, err := shell.Execute("echo", strings.Split("template", " "), map[string]string{}, tt.enableLiveOutput)
@@ -72,7 +74,7 @@ Usage: helm template [NAME] [CHART] [flags]
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
w := &bytes.Buffer{}
got, err := LiveOutput(tt.cmd, w)
got, err := LiveOutput(context.Background(), tt.cmd, w)
if (err != nil) != tt.wantErr {
t.Errorf("LiveOutput() error = %v, wantErr %v", err, tt.wantErr)
return