-
-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop Helm v2 support #613
Drop Helm v2 support #613
Conversation
efeb947
to
e0b8d7a
Compare
@mumoshu do you think is ok that drop helm v2 support in the next version? |
@yxxhero I believe so. I presume Helm v2 has been deprecated since Sep 2020 and not maintained since Dec 2020. It's 2023, and no one should be using Helm v2! |
@xiaomudk yeah. looking forward to updating. 💯 |
18eb77b
to
5c9d412
Compare
{Name: "test2", Flags: []string(nil)}, | ||
{Name: "test3", Flags: []string(nil)}, | ||
{Name: "test2", Flags: []string{}}, | ||
{Name: "test3", Flags: []string{}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change the code?
@@ -510,14 +508,11 @@ releases: | |||
{label: "name!=", expectedCount: 0, expectErr: true, errMsg: "in ./helmfile.yaml: in .helmfiles[0]: in /path/to/helmfile.d/a1.yaml: malformed label: name!=. Expected label in form k=v or k!=v"}, | |||
{label: "name", expectedCount: 0, expectErr: true, errMsg: "in ./helmfile.yaml: in .helmfiles[0]: in /path/to/helmfile.d/a1.yaml: malformed label: name. Expected label in form k=v or k!=v"}, | |||
// See https://github.com/roboll/helmfile/issues/193 | |||
{label: "duplicatedNs=yes", expectedCount: 0, expectErr: true, errMsg: "in ./helmfile.yaml: in .helmfiles[2]: in /path/to/helmfile.d/b.yaml: duplicate release \"foo\" found in namespace \"zoo\" in kubecontext \"default\": there were 2 releases named \"foo\" matching specified selector"}, | |||
{label: "duplicatedCtx=yes", expectedCount: 0, expectErr: true, errMsg: "in ./helmfile.yaml: in .helmfiles[2]: in /path/to/helmfile.d/b.yaml: duplicate release \"foo\" found in namespace \"zoo\" in kubecontext \"default\": there were 2 releases named \"foo\" matching specified selector"}, | |||
{label: "duplicatedNs=yes", expectedCount: 0, expectErr: true, errMsg: "in ./helmfile.yaml: in .helmfiles[2]: in /path/to/helmfile.d/b.yaml: duplicate release \"foo\" found in kubecontext \"default\": there were 2 releases named \"foo\" matching specified selector"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zoo --> foo? why?
helmV3ListFlags = "--kube-contextdefault--uninstalling--deployed--failed--pending" | ||
helmV3ListFlagsWithoutKubeContext = "--uninstalling--deployed--failed--pending" | ||
) | ||
|
||
func listFlags(namespace, kubeContext string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some tests for this function will be better.
@xiaomudk Thanks for your great work. |
@@ -26,6 +26,10 @@ func NewRun(st *state.HelmState, helm helmexec.Interface, ctx Context) *Run { | |||
panic("Assertion failed: helmexec.Interface must not be nil") | |||
} | |||
|
|||
if !helm.IsHelm3() { | |||
panic("helmfile has deprecated helm2 since v1.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, panic message is not very friendly
@@ -289,7 +288,7 @@ exec: helm --kube-context dev upgrade --install release chart --timeout 10 --wai | |||
buffer.Reset() | |||
err = helm.SyncRelease(HelmContext{}, "release", "chart") | |||
expected = `Upgrading release=release, chart=chart | |||
exec: helm --kube-context dev upgrade --install release chart | |||
exec: helm --kube-context dev upgrade --install release chart --history-max 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--history-max? why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got. but why 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably because 0 is the empty value hence the default value for the HistoryMax field of ReleaseSpec? It's propagated via the --history-max flag here:
Line 255 in 1f134d9
flags = append(flags, "--history-max", strconv.Itoa(context.HistoryMax)) |
No behavior change introduced in this pull request. I presume it's just that we turned this helm v2 based test to helm v3 based one and the additional
--history-max
flag is the consequence of that.
Signed-off-by: xiaomudk <[email protected]>
Signed-off-by: xiaomudk <[email protected]>
Signed-off-by: xiaomudk <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you so much for your awesome work @xiaomudk!
#589
Signed-off-by: xiaomudk [email protected]