@@ -21,6 +21,7 @@ package e2e
21
21
22
22
import (
23
23
"context"
24
+ "os"
24
25
25
26
. "github.com/onsi/ginkgo/v2"
26
27
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
@@ -34,23 +35,26 @@ import (
34
35
// When new minor releases are added (with the same contract) we will need to work on this
35
36
// if we want to continue testing v0.6.
36
37
var _ = Describe ("When testing clusterctl upgrades (v0.6=>current) [clusterctl-upgrade]" , func () {
37
- It ("should succeed" , func () {
38
- ctx := context .TODO ()
39
- shared .SetEnvVar ("USE_CI_ARTIFACTS" , "true" , false )
40
- shared .SetEnvVar ("DOWNLOAD_E2E_IMAGE" , "true" , false )
41
-
42
- capi_e2e .ClusterctlUpgradeSpec (ctx , func () capi_e2e.ClusterctlUpgradeSpecInput {
43
- return capi_e2e.ClusterctlUpgradeSpecInput {
44
- E2EConfig : e2eCtx .E2EConfig ,
45
- ClusterctlConfigPath : e2eCtx .Environment .ClusterctlConfigPath ,
46
- BootstrapClusterProxy : e2eCtx .Environment .BootstrapClusterProxy ,
47
- ArtifactFolder : e2eCtx .Settings .ArtifactFolder ,
48
- SkipCleanup : false ,
49
- InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.0/clusterctl-{OS}-{ARCH}" ,
50
- InitWithProvidersContract : "v1beta1" ,
51
- MgmtFlavor : shared .FlavorDefault ,
52
- WorkloadFlavor : shared .FlavorV1alpha5 ,
53
- }
54
- })
38
+ ctx := context .TODO ()
39
+ // Set environment variables for rendering the cluster templates.
40
+ // We cannot use shared.SetEnvVar here because it tries to log things
41
+ // using `By`, which cannot be done outside of `It` blocks.
42
+ // We cannot put this in an `It` block either since `ClusterctlUpgradeSpec`
43
+ // contains `BeforeEach` which cannot be inside `It`.
44
+ _ = os .Setenv ("USE_CI_ARTIFACTS" , "true" )
45
+ _ = os .Setenv ("DOWNLOAD_E2E_IMAGE" , "true" )
46
+
47
+ capi_e2e .ClusterctlUpgradeSpec (ctx , func () capi_e2e.ClusterctlUpgradeSpecInput {
48
+ return capi_e2e.ClusterctlUpgradeSpecInput {
49
+ E2EConfig : e2eCtx .E2EConfig ,
50
+ ClusterctlConfigPath : e2eCtx .Environment .ClusterctlConfigPath ,
51
+ BootstrapClusterProxy : e2eCtx .Environment .BootstrapClusterProxy ,
52
+ ArtifactFolder : e2eCtx .Settings .ArtifactFolder ,
53
+ SkipCleanup : false ,
54
+ InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.3.0/clusterctl-{OS}-{ARCH}" ,
55
+ InitWithProvidersContract : "v1beta1" ,
56
+ MgmtFlavor : shared .FlavorDefault ,
57
+ WorkloadFlavor : shared .FlavorV1alpha5 ,
58
+ }
55
59
})
56
60
})
0 commit comments