Skip to content

Commit d599c5b

Browse files
committed
add a fallback command for checking helm binary version (v4.x)
1 parent 99c0ea1 commit d599c5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/cli/create_helm.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ func CreateHelm(ctx context.Context, options *CreateOptions, globalFlags *flags.
139139

140140
output, err := exec.Command(helmBinaryPath, "version", "--client", "--template", "{{.Version}}").Output()
141141
if err != nil {
142-
return err
142+
// Helm v4.x does not support the --client flag
143+
output, err = exec.Command(helmBinaryPath, "version", "--template", "{{.Version}}").Output()
144+
if err != nil {
145+
return err
146+
}
143147
}
144148

145149
err = clihelper.CheckHelmVersion(string(output))

0 commit comments

Comments
 (0)