From d3d3393f3f3d20643a46e64ba73d5dd280101c04 Mon Sep 17 00:00:00 2001 From: Nan Yu Date: Wed, 4 Oct 2023 16:07:15 +0000 Subject: [PATCH] test: Fix the missing KUBECONFIG env variable (#915) The ExecWithDebug function is invoked to run `nomos status`, which requires the KUBECONFIG env variable to be set. Otherwise, `nomos status` will fail with no cluster info, for example, https://oss.gprow.dev/view/gs/oss-prow-build-kpt-config-sync/logs/kpt-config-sync-standard-rapid-latest-stress/1709417838403391488. --- e2e/nomostest/testshell/shell.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/nomostest/testshell/shell.go b/e2e/nomostest/testshell/shell.go index 1e82e89150..59671d0f42 100644 --- a/e2e/nomostest/testshell/shell.go +++ b/e2e/nomostest/testshell/shell.go @@ -118,7 +118,8 @@ func (tc *TestShell) Helm(args ...string) ([]byte, error) { // KUBECONFIG environment variable and debug logging. func (tc *TestShell) ExecWithDebug(name string, args ...string) ([]byte, error) { tc.Logger.Debugf("%s %s", name, strings.Join(args, " ")) - out, err := exec.Command(name, args...).CombinedOutput() + cmd := tc.Command(name, args...) + out, err := cmd.CombinedOutput() if err != nil { if !tc.Logger.IsDebugEnabled() { tc.Logger.Infof("%s %s", name, strings.Join(args, " "))