diff --git a/modules/helm/cmd.go b/modules/helm/cmd.go index 7fdc372a0..8c5b36fe1 100644 --- a/modules/helm/cmd.go +++ b/modules/helm/cmd.go @@ -50,8 +50,19 @@ func getValuesArgsE(t testing.TestingT, options *Options, args ...string) ([]str return args, nil } -// RunHelmCommandAndGetOutputE runs helm with the given arguments and options and returns stdout/stderr. +// RunHelmCommandAndGetOutputE runs helm with the given arguments and options and returns combined, interleaved stdout/stderr. func RunHelmCommandAndGetOutputE(t testing.TestingT, options *Options, cmd string, additionalArgs ...string) (string, error) { + helmCmd := prepareHelmCommand(t, options, cmd, additionalArgs...) + return shell.RunCommandAndGetOutputE(t, helmCmd) +} + +// RunHelmCommandAndGetStdOutE runs helm with the given arguments and options and returns stdout. +func RunHelmCommandAndGetStdOutE(t testing.TestingT, options *Options, cmd string, additionalArgs ...string) (string, error) { + helmCmd := prepareHelmCommand(t, options, cmd, additionalArgs...) + return shell.RunCommandAndGetStdOutE(t, helmCmd) +} + +func prepareHelmCommand(t testing.TestingT, options *Options, cmd string, additionalArgs ...string) shell.Command { args := []string{cmd} args = getCommonArgs(options, args...) args = append(args, additionalArgs...) @@ -63,5 +74,5 @@ func RunHelmCommandAndGetOutputE(t testing.TestingT, options *Options, cmd strin Env: options.EnvVars, Logger: options.Logger, } - return shell.RunCommandAndGetOutputE(t, helmCmd) + return helmCmd } diff --git a/modules/helm/template.go b/modules/helm/template.go index 84552e74f..919e2964a 100644 --- a/modules/helm/template.go +++ b/modules/helm/template.go @@ -61,7 +61,7 @@ func RenderTemplateE(t testing.TestingT, options *Options, chartDir string, rele args = append(args, releaseName, chartDir) // Finally, call out to helm template command - return RunHelmCommandAndGetOutputE(t, options, "template", args...) + return RunHelmCommandAndGetStdOutE(t, options, "template", args...) } // UnmarshalK8SYaml is the same as UnmarshalK8SYamlE, but will fail the test if there is an error.