mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 00:13:37 +02:00
fix: support large output with --enable-live-ouput (#1139)
* fix: support large output with --enable-live-ouput This replaces Scanner with ReadString to handle large amount of data returned by helm ouptut when executing diff action - Changing pkg/helmexec/runner_test.go TestLiveOutput test, adding test with large amount of data, reproducing the issue before applying this fix - Changing pkg/helmexec/runner.go Scanner with Readstring Resolves https://github.com/helmfile/helmfile/issues/893 Signed-off-by: Franck Labatut <franck.labatut@ubisoft.com> * fix: prevent data race Signed-off-by: Franck Labatut <franck.labatut@ubisoft.com> --------- Signed-off-by: Franck Labatut <franck.labatut@ubisoft.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package helmexec
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
_ "embed"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"strings"
|
||||
@@ -48,6 +49,9 @@ func TestShellRunner_Execute(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
//go:embed testdata/live-output-data.txt
|
||||
var liveOutputData string
|
||||
|
||||
func TestLiveOutput(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -55,6 +59,12 @@ func TestLiveOutput(t *testing.T) {
|
||||
wantW string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "live_output_data",
|
||||
cmd: exec.Command("cat", "testdata/live-output-data.txt"),
|
||||
wantW: liveOutputData,
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "echo_template",
|
||||
cmd: exec.Command("echo", "template"),
|
||||
|
||||
Reference in New Issue
Block a user