Append --force-update for specific helm versions. (#1494)

* Parse and process helm version using github.com/Masterminds/semver/v3.

* Add --force-update only when Helm version >= 3.3.2, < 3.3.4.

See: https://github.com/helm/helm/pull/8777.

* Add test cases.
This commit is contained in:
Wi1dcard
2020-10-12 09:20:55 +09:00
committed by GitHub
parent b284b7be83
commit 5d8eba9b29
11 changed files with 87 additions and 134 deletions
+1 -1
View File
@@ -2462,7 +2462,7 @@ func (helm *mockHelmExec) GetVersion() helmexec.Version {
return helmexec.Version{}
}
func (helm *mockHelmExec) IsVersionAtLeast(major int, minor int, patch int) bool {
func (helm *mockHelmExec) IsVersionAtLeast(versionStr string) bool {
return false
}
+1 -1
View File
@@ -97,7 +97,7 @@ func (helm *noCallHelmExec) GetVersion() helmexec.Version {
return helmexec.Version{}
}
func (helm *noCallHelmExec) IsVersionAtLeast(major int, minor int, patch int) bool {
func (helm *noCallHelmExec) IsVersionAtLeast(versionStr string) bool {
helm.doPanic()
return false
}