@@ -129,7 +129,7 @@ var _ = BeforeSuite(func() {
129129 err = k .WaitForNamespaceDelete (operatorNamespace )
130130 Expect (err ).ToNot (HaveOccurred ())
131131
132- deployOperator (k , e2eCfg )
132+ deployOperator (k , e2eCfg , false )
133133
134134 // Somehow rancher needs to be restarted after an elemental-operator upgrade
135135 // to get machineregistration working
@@ -281,7 +281,7 @@ var _ = BeforeSuite(func() {
281281
282282 })
283283
284- deployOperator (k , e2eCfg )
284+ deployOperator (k , e2eCfg , false )
285285})
286286
287287var _ = AfterSuite (func () {
@@ -299,11 +299,21 @@ func isOperatorInstalled(k *kubectl.Kubectl) bool {
299299 return len (pods ) > 0
300300}
301301
302- func deployOperator (k * kubectl.Kubectl , config * e2eConfig.E2EConfig ) {
302+ func deployOperator (k * kubectl.Kubectl , config * e2eConfig.E2EConfig , oldChartName bool ) {
303+ // This is a temporary workaround to cope with the chart name change.
304+ // During the downgrade test we need to use the old name (with "-chart" suffix)
305+ // See: https://github.com/rancher/elemental-operator/issues/826
306+ chartName := operatorName
307+ chartCRDsName := operatorCRDsName
308+ if oldChartName {
309+ chartName = fmt .Sprintf ("%s-chart" , chartName )
310+ chartCRDsName = fmt .Sprintf ("%s-chart" , chartCRDsName )
311+ }
312+
303313 By ("Deploying elemental-operator chart" , func () {
304314 Expect (kubectl .RunHelmBinaryWithCustomErr (
305315 "upgrade" , "--install" ,
306- operatorCRDsName ,
316+ chartCRDsName ,
307317 config .CRDsChart ,
308318 "--set" , "debug=true" ,
309319 "--set" , fmt .Sprintf ("replicas=%s" , config .OperatorReplicas ),
@@ -329,7 +339,7 @@ func deployOperator(k *kubectl.Kubectl, config *e2eConfig.E2EConfig) {
329339
330340 Expect (kubectl .RunHelmBinaryWithCustomErr (
331341 "upgrade" , "--install" ,
332- operatorName ,
342+ chartName ,
333343 config .Chart ,
334344 "--set" , "debug=true" ,
335345 "--set" , fmt .Sprintf ("replicas=%s" , config .OperatorReplicas ),
0 commit comments