@@ -22,7 +22,7 @@ import (
2222 . "github.com/onsi/gomega"
2323)
2424
25- // helmInstall installs the local 2. 3.x chart into the given namespace with --wait.
25+ // helmInstall installs the local 3.x chart into the given namespace with --wait.
2626func helmInstall (namespace string , extraArgs ... string ) error {
2727 args := []string {
2828 "install" ,
@@ -39,31 +39,31 @@ func helmInstall(namespace string, extraArgs ...string) error {
3939 return Run ("helm" , args ... )
4040}
4141
42- // helmUpgrade upgrades to the local 2. 3.x chart in the given namespace with --wait.
43- func helmUpgrade (namespace string ) error {
44- return Run ("helm" , "upgrade" ,
45- helmReleaseName ,
46- localChartPath ,
47- "--namespace" , namespace ,
48- "--set" , "image.repository=" + operatorImageRepo ,
49- "--set" , "image.tag=" + operatorImageTag ,
50- "--set" , "image.pullPolicy=Never" ,
51- "--wait" ,
52- "--timeout" , "2m" ,
53- )
54- }
55-
56- // helmCleanup removes all resources that 2. 3.x chart may have left behind in
42+ // helmUpgrade upgrades to the local 3.x chart in the given namespace with --wait.
43+ // func helmUpgrade(namespace string) error {
44+ // return Run("helm", "upgrade",
45+ // helmReleaseName,
46+ // localChartPath,
47+ // "--namespace", namespace,
48+ // "--set", "image.repository="+operatorImageRepo,
49+ // "--set", "image.tag="+operatorImageTag,
50+ // "--set", "image.pullPolicy=Never",
51+ // "--wait",
52+ // "--timeout", "2m",
53+ // )
54+ // }
55+
56+ // helmCleanup removes all resources that 3.x chart may have left behind in
5757// the given namespace, including the Helm release itself.
5858func helmCleanup (namespace string ) {
5959 _ = Run ("helm" , "uninstall" , helmReleaseName , "--namespace" , namespace )
60- _ = Kubectl ("delete" , "clusterrole" , "emqx-operator-manager-role" , "--ignore-not-found" )
61- _ = Kubectl ("delete" , "clusterrolebinding" , "emqx-operator-manager-rolebinding" , "--ignore-not-found" )
62- _ = Kubectl ("delete" , "clusterrole" , "emqx-operator-pre-upgrade" , "--ignore-not-found" )
63- _ = Kubectl ("delete" , "clusterrolebinding" , "emqx-operator-pre-upgrade" , "--ignore-not-found" )
64- _ = Kubectl ("delete" , "crd" , "emqxes.apps.emqx.io" , "--ignore-not-found" )
65- _ = Kubectl ("delete" , "crd" , "rebalances.apps.emqx.io" , "--ignore-not-found" )
66- _ = Kubectl ("delete" , "ns" , namespace , "--ignore-not-found" )
60+ _ = Kubectl ("delete" , "clusterrole" , "emqx-operator-manager-role" )
61+ _ = Kubectl ("delete" , "clusterrolebinding" , "emqx-operator-manager-rolebinding" )
62+ _ = Kubectl ("delete" , "clusterrole" , "emqx-operator-pre-upgrade" )
63+ _ = Kubectl ("delete" , "clusterrolebinding" , "emqx-operator-pre-upgrade" )
64+ _ = Kubectl ("delete" , "crd" , "emqxes.apps.emqx.io" )
65+ _ = Kubectl ("delete" , "crd" , "rebalances.apps.emqx.io" )
66+ _ = Kubectl ("delete" , "ns" , namespace )
6767}
6868
6969//nolint:errcheck
@@ -89,13 +89,14 @@ var _ = Describe("Helm Install", Ordered, func() {
8989 }
9090 })
9191
92- It ("should install cleanly / cleanup no-op " , func () {
93- By ("install 2. 3.x chart" )
92+ It ("should install cleanly" , func () {
93+ By ("install 3.x chart" )
9494 Expect (helmInstall (namespace )).To (Succeed ())
9595
9696 By ("verify CRDs are installed" )
9797 Expect (crdExists ("emqxes.apps.emqx.io" )).To (BeTrue ())
98- Expect (crdExists ("rebalances.apps.emqx.io" )).To (BeTrue ())
98+ // NOTE: Rebalance controller is disabled in this release. See api/v3alpha1/rebalance_types.go.
99+ // Expect(crdExists("rebalances.apps.emqx.io")).To(BeTrue())
99100
100101 By ("verify operator deployment is available" )
101102 Expect (Kubectl ("wait" , "deployment" ,
@@ -105,22 +106,4 @@ var _ = Describe("Helm Install", Ordered, func() {
105106 "--timeout" , "1m" ,
106107 )).To (Succeed ())
107108 })
108-
109- It ("should install cleanly / pre-upgrade check disabled" , func () {
110- By ("install 2.3.x with pre-upgrade check disabled" )
111- Expect (helmInstall (namespace , "--set" , "upgrade.preUpgradeCheck=false" )).
112- To (Succeed ())
113-
114- By ("verify operator is running" )
115- Expect (Kubectl ("wait" , "deployment" ,
116- "emqx-operator-controller-manager" ,
117- "--for" , "condition=Available" ,
118- "--namespace" , namespace ,
119- "--timeout" , "1m" ,
120- )).To (Succeed ())
121-
122- By ("verify CRDs are installed" )
123- Expect (crdExists ("emqxes.apps.emqx.io" )).To (BeTrue ())
124- Expect (crdExists ("rebalances.apps.emqx.io" )).To (BeTrue ())
125- })
126109})
0 commit comments