@@ -23,25 +23,65 @@ import (
23
23
"context"
24
24
25
25
. "github.com/onsi/ginkgo/v2"
26
+ . "github.com/onsi/gomega"
26
27
capi_e2e "sigs.k8s.io/cluster-api/test/e2e"
28
+ "sigs.k8s.io/cluster-api/test/framework/clusterctl"
27
29
28
30
"sigs.k8s.io/cluster-api-provider-openstack/test/e2e/shared"
29
31
)
30
32
31
- const OldCAPIVersion = "v1.6.0"
33
+ var (
34
+ capoRelease011 string
35
+ capoRelease012 string
36
+ capiRelease19 string
37
+ )
32
38
33
- var _ = Describe ("When testing clusterctl upgrades (v0.10 =>current) [clusterctl-upgrade]" , func () {
39
+ var _ = Describe ("When testing clusterctl upgrades (v0.11 =>current) [clusterctl-upgrade]" , func () {
34
40
BeforeEach (func (ctx context.Context ) {
35
41
shared .ApplyCoreImagesPlus (ctx , e2eCtx , upgradeImage )
42
+ setDownloadE2EImageEnvVar ()
43
+ // Note: This gives the version without the 'v' prefix, so we need to add it below.
44
+ capoRelease011 , err = clusterctl .ResolveRelease (ctx , "go://github.com/kubernetes-sigs/cluster-api-provider-openstack@v0.11" )
45
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPO" )
46
+ capoRelease011 = "v" + capoRelease011
47
+ // Note: This gives the version without the 'v' prefix, so we need to add it below.
48
+ capiRelease19 , err = capi_e2e .GetStableReleaseOfMinor (ctx , "1.9" )
49
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPI" )
50
+ capiRelease19 = "v" + capiRelease19
51
+ })
36
52
37
- // The upgrade job can't use image references in its machine templates,
38
- // so we must wait for the images to be available before running the
39
- // test.
40
- coreImages := shared .CoreImages (e2eCtx )
41
- allImages := append (coreImages , upgradeImage )
42
- shared .WaitForGlanceImagesAvailable (ctx , e2eCtx , allImages )
53
+ capi_e2e .ClusterctlUpgradeSpec (context .TODO (), func () capi_e2e.ClusterctlUpgradeSpecInput {
54
+ return capi_e2e.ClusterctlUpgradeSpecInput {
55
+ E2EConfig : e2eCtx .E2EConfig ,
56
+ ClusterctlConfigPath : e2eCtx .Environment .ClusterctlConfigPath ,
57
+ BootstrapClusterProxy : e2eCtx .Environment .BootstrapClusterProxy ,
58
+ ArtifactFolder : e2eCtx .Settings .ArtifactFolder ,
59
+ SkipCleanup : false ,
60
+ InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease19 + "/clusterctl-{OS}-{ARCH}" ,
61
+ InitWithProvidersContract : "v1beta1" ,
62
+ InitWithInfrastructureProviders : []string {"openstack:" + capoRelease011 },
63
+ InitWithCoreProvider : "cluster-api:" + capiRelease19 ,
64
+ InitWithBootstrapProviders : []string {"kubeadm:" + capiRelease19 },
65
+ InitWithControlPlaneProviders : []string {"kubeadm:" + capiRelease19 },
66
+ MgmtFlavor : shared .FlavorDefault ,
67
+ WorkloadFlavor : shared .FlavorDefault ,
68
+ InitWithKubernetesVersion : e2eCtx .E2EConfig .MustGetVariable (shared .KubernetesVersion ),
69
+ }
70
+ })
71
+ })
43
72
73
+ var _ = Describe ("When testing clusterctl upgrades (v0.12=>current) [clusterctl-upgrade]" , func () {
74
+ BeforeEach (func (ctx context.Context ) {
75
+ shared .ApplyCoreImagesPlus (ctx , e2eCtx , upgradeImage )
44
76
setDownloadE2EImageEnvVar ()
77
+ // Note: This gives the version without the 'v' prefix, so we need to add it below.
78
+ capoRelease012 , err = clusterctl .ResolveRelease (ctx , "go://github.com/kubernetes-sigs/cluster-api-provider-openstack@v0.12" )
79
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPO" )
80
+ capoRelease012 = "v" + capoRelease012
81
+ // Note: This gives the version without the 'v' prefix, so we need to add it below.
82
+ capiRelease19 , err = capi_e2e .GetStableReleaseOfMinor (ctx , "1.9" )
83
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPI" )
84
+ capiRelease19 = "v" + capiRelease19
45
85
})
46
86
47
87
capi_e2e .ClusterctlUpgradeSpec (context .TODO (), func () capi_e2e.ClusterctlUpgradeSpecInput {
@@ -51,14 +91,14 @@ var _ = Describe("When testing clusterctl upgrades (v0.10=>current) [clusterctl-
51
91
BootstrapClusterProxy : e2eCtx .Environment .BootstrapClusterProxy ,
52
92
ArtifactFolder : e2eCtx .Settings .ArtifactFolder ,
53
93
SkipCleanup : false ,
54
- InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + OldCAPIVersion + "/clusterctl-{OS}-{ARCH}" ,
94
+ InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease19 + "/clusterctl-{OS}-{ARCH}" ,
55
95
InitWithProvidersContract : "v1beta1" ,
56
- InitWithInfrastructureProviders : []string {"openstack:v0.10.0" },
57
- InitWithCoreProvider : "cluster-api:" + OldCAPIVersion ,
58
- InitWithBootstrapProviders : []string {"kubeadm:" + OldCAPIVersion },
59
- InitWithControlPlaneProviders : []string {"kubeadm:" + OldCAPIVersion },
96
+ InitWithInfrastructureProviders : []string {"openstack:" + capoRelease012 },
97
+ InitWithCoreProvider : "cluster-api:" + capiRelease19 ,
98
+ InitWithBootstrapProviders : []string {"kubeadm:" + capiRelease19 },
99
+ InitWithControlPlaneProviders : []string {"kubeadm:" + capiRelease19 },
60
100
MgmtFlavor : shared .FlavorDefault ,
61
- WorkloadFlavor : shared .FlavorWithoutORC ,
101
+ WorkloadFlavor : shared .FlavorDefault ,
62
102
InitWithKubernetesVersion : e2eCtx .E2EConfig .MustGetVariable (shared .KubernetesVersion ),
63
103
}
64
104
})
0 commit comments