From 9e4e19296e8b86ea569ccdee1bc7d49eef1ddcab Mon Sep 17 00:00:00 2001 From: jt-dd <112463504+jt-dd@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:25:45 +0200 Subject: [PATCH] Fix interactive mod (#210) * fix * refactor * fixing default conf for system tests --- pkg/cmd/util.go | 2 +- pkg/ingestor/puller/puller_test.go | 3 ++- test/system/kubehound_dump.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/util.go b/pkg/cmd/util.go index 60912c08b..e90cb9dad 100644 --- a/pkg/cmd/util.go +++ b/pkg/cmd/util.go @@ -12,7 +12,7 @@ func AskForConfirmation() (bool, error) { var response string _, err := fmt.Scanln(&response) - if err.Error() != "unexpected newline" { + if err != nil && err.Error() != "unexpected newline" { return false, fmt.Errorf("scanln: %w", err) } diff --git a/pkg/ingestor/puller/puller_test.go b/pkg/ingestor/puller/puller_test.go index 93037f411..0d36977df 100644 --- a/pkg/ingestor/puller/puller_test.go +++ b/pkg/ingestor/puller/puller_test.go @@ -130,7 +130,8 @@ func TestExtractTarGz(t *testing.T) { if err != nil { t.Error(err) } - if err := ExtractTarGz(false, "./testdata/archive.tar.gz", tmpPath, tt.args.maxArchiveSize); (err != nil) != tt.wantErr { + dryRun := false + if err := ExtractTarGz(dryRun, "./testdata/archive.tar.gz", tmpPath, tt.args.maxArchiveSize); (err != nil) != tt.wantErr { t.Errorf("ExtractTarGz() error = %v, wantErr %v", err, tt.wantErr) } for _, file := range tt.expectedFiles { diff --git a/test/system/kubehound_dump.yaml b/test/system/kubehound_dump.yaml index b70c008b2..4398162c2 100644 --- a/test/system/kubehound_dump.yaml +++ b/test/system/kubehound_dump.yaml @@ -33,7 +33,7 @@ ingestor: region: "" # (i.e.: us-west-2) temp_dir: "/tmp/kubehound" archive_name: "archive.tar.gz" - max_archive_size: 1073741824 # 1GB + max_archive_size: 2147483648 # 2GB api: # GRPC endpoint for the ingestor endpoint: "127.0.0.1:9000" insecure: true \ No newline at end of file