Skip to content

Commit

Permalink
Output instead of CombinedOutput when parsing helm version output
Browse files Browse the repository at this point in the history
if there are warnings in the helm output (such as kubeconfig permissions too loose) it will cause the version to erroneously be detected as V2.
  • Loading branch information
clhuang authored and hypnoglow committed Oct 28, 2023
1 parent ecbbc05 commit 5297e7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/helmutil/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var helm3Detected func() bool

func helmVersionCommand() bool {
cmd := exec.Command("helm", "version", "--short", "--client")
out, err := cmd.CombinedOutput()
out, err := cmd.Output()

Check warning on line 33 in internal/helmutil/version.go

View check run for this annotation

Codecov / codecov/patch

internal/helmutil/version.go#L33

Added line #L33 was not covered by tests
if err != nil {
// Should not happen in normal cases (when helm is properly installed).
// Anyway, for now fallback to v2 for backward compatibility for helm-s3 users that are still on v2.
Expand Down

0 comments on commit 5297e7b

Please sign in to comment.