mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-04 12:01:47 +02:00
@@ -646,7 +646,7 @@ func (helm *execer) write(w io.Writer, out []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func (helm *execer) IsHelm3() bool {
|
||||
func (helm *execer) IsOverHelm3() bool {
|
||||
return helm.version.Major() >= 3
|
||||
}
|
||||
|
||||
|
||||
@@ -1063,14 +1063,14 @@ exec: helm --kubeconfig config --kube-context dev template release https://examp
|
||||
}
|
||||
}
|
||||
|
||||
func Test_IsHelm3(t *testing.T) {
|
||||
func Test_IsOverHelm3(t *testing.T) {
|
||||
helm2Runner := mockRunner{output: []byte("Client: v2.16.0+ge13bc94\n")}
|
||||
helm, err := New("helm", HelmExecOptions{}, NewLogger(os.Stdout, "info"), "", "dev", &helm2Runner)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if helm.IsHelm3() {
|
||||
t.Error("helmexec.IsHelm3() - Detected Helm 3 with Helm 2 version")
|
||||
if helm.IsOverHelm3() {
|
||||
t.Error("helmexec.IsOverHelm3() - Detected Helm 3 with Helm 2 version")
|
||||
}
|
||||
|
||||
helm3Runner := mockRunner{output: []byte("v3.0.0+ge29ce2a\n")}
|
||||
@@ -1078,8 +1078,8 @@ func Test_IsHelm3(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if !helm.IsHelm3() {
|
||||
t.Error("helmexec.IsHelm3() - Failed to detect Helm 3")
|
||||
if !helm.IsOverHelm3() {
|
||||
t.Error("helmexec.IsOverHelm3() - Failed to detect Helm 3")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ type Interface interface {
|
||||
TestRelease(context HelmContext, name string, flags ...string) error
|
||||
List(context HelmContext, filter string, flags ...string) (string, error)
|
||||
DecryptSecret(context HelmContext, name string, flags ...string) (string, error)
|
||||
IsHelm3() bool
|
||||
IsOverHelm3() bool
|
||||
GetVersion() Version
|
||||
IsVersionAtLeast(versionStr string) bool
|
||||
ShowChart(chart string) (chart.Metadata, error)
|
||||
@@ -41,5 +41,5 @@ type Interface interface {
|
||||
|
||||
type DependencyUpdater interface {
|
||||
UpdateDeps(chart string) error
|
||||
IsHelm3() bool
|
||||
IsOverHelm3() bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user