Skip to content

Commit

Permalink
Fallback to Helm v3 if Helm version is not detected
Browse files Browse the repository at this point in the history
References: #329
  • Loading branch information
hypnoglow committed Nov 22, 2023
1 parent 5f4f891 commit dc16a29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

- Supported (and tested against) Helm versions updated to 3.12.3 and 3.13.1.
- Helm version detection now fallbacks to Helm v3 in case of errors, as Helm v2
is deprecated for 3 years already.

## [0.15.1] - 2023-09-20

Expand Down
5 changes: 3 additions & 2 deletions internal/helmutil/version.go
Expand Up @@ -33,8 +33,9 @@ func helmVersionCommand() bool {
out, err := cmd.Output()
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.
return false
// Anyway, fallback to v3 since helm v2 was deprecated a long time ago
// and the majority of helm-s3 users use v3.
return true

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

View check run for this annotation

Codecov / codecov/patch

internal/helmutil/version.go#L36-L38

Added lines #L36 - L38 were not covered by tests
}

return strings.HasPrefix(string(out), "v3.")
Expand Down

0 comments on commit dc16a29

Please sign in to comment.