@@ -23,25 +23,61 @@ 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
+ capoRelease011 ,
err = clusterctl .
ResolveRelease (
ctx ,
"go://github.com/kubernetes-sigs/[email protected] " )
44
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPO" )
45
+ // Note: This gives the version without the 'v' prefix, so we need to add it below.
46
+ capiRelease19 , err = capi_e2e .GetStableReleaseOfMinor (ctx , "1.9" )
47
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPI" )
48
+ capiRelease19 = "v" + capiRelease19
49
+ })
36
50
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 )
51
+ capi_e2e .ClusterctlUpgradeSpec (context .TODO (), func () capi_e2e.ClusterctlUpgradeSpecInput {
52
+ return capi_e2e.ClusterctlUpgradeSpecInput {
53
+ E2EConfig : e2eCtx .E2EConfig ,
54
+ ClusterctlConfigPath : e2eCtx .Environment .ClusterctlConfigPath ,
55
+ BootstrapClusterProxy : e2eCtx .Environment .BootstrapClusterProxy ,
56
+ ArtifactFolder : e2eCtx .Settings .ArtifactFolder ,
57
+ SkipCleanup : false ,
58
+ InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease19 + "/clusterctl-{OS}-{ARCH}" ,
59
+ InitWithProvidersContract : "v1beta1" ,
60
+ InitWithInfrastructureProviders : []string {"openstack:" + capoRelease011 },
61
+ InitWithCoreProvider : "cluster-api:" + capiRelease19 ,
62
+ InitWithBootstrapProviders : []string {"kubeadm:" + capiRelease19 },
63
+ InitWithControlPlaneProviders : []string {"kubeadm:" + capiRelease19 },
64
+ MgmtFlavor : shared .FlavorDefault ,
65
+ WorkloadFlavor : shared .FlavorDefault ,
66
+ InitWithKubernetesVersion : e2eCtx .E2EConfig .MustGetVariable (shared .KubernetesVersion ),
67
+ }
68
+ })
69
+ })
43
70
71
+ var _ = Describe ("When testing clusterctl upgrades (v0.12=>current) [clusterctl-upgrade]" , func () {
72
+ BeforeEach (func (ctx context.Context ) {
73
+ shared .ApplyCoreImagesPlus (ctx , e2eCtx , upgradeImage )
44
74
setDownloadE2EImageEnvVar ()
75
+ capoRelease012 ,
err = clusterctl .
ResolveRelease (
ctx ,
"go://github.com/kubernetes-sigs/[email protected] " )
76
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPO" )
77
+ // Note: This gives the version without the 'v' prefix, so we need to add it below.
78
+ capiRelease19 , err = capi_e2e .GetStableReleaseOfMinor (ctx , "1.9" )
79
+ Expect (err ).ToNot (HaveOccurred (), "failed to get stable release of CAPI" )
80
+ capiRelease19 = "v" + capiRelease19
45
81
})
46
82
47
83
capi_e2e .ClusterctlUpgradeSpec (context .TODO (), func () capi_e2e.ClusterctlUpgradeSpecInput {
@@ -51,14 +87,14 @@ var _ = Describe("When testing clusterctl upgrades (v0.10=>current) [clusterctl-
51
87
BootstrapClusterProxy : e2eCtx .Environment .BootstrapClusterProxy ,
52
88
ArtifactFolder : e2eCtx .Settings .ArtifactFolder ,
53
89
SkipCleanup : false ,
54
- InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + OldCAPIVersion + "/clusterctl-{OS}-{ARCH}" ,
90
+ InitWithBinary : "https://github.com/kubernetes-sigs/cluster-api/releases/download/" + capiRelease19 + "/clusterctl-{OS}-{ARCH}" ,
55
91
InitWithProvidersContract : "v1beta1" ,
56
- InitWithInfrastructureProviders : []string {"openstack:v0.10.0" },
57
- InitWithCoreProvider : "cluster-api:" + OldCAPIVersion ,
58
- InitWithBootstrapProviders : []string {"kubeadm:" + OldCAPIVersion },
59
- InitWithControlPlaneProviders : []string {"kubeadm:" + OldCAPIVersion },
92
+ InitWithInfrastructureProviders : []string {"openstack:" + capoRelease012 },
93
+ InitWithCoreProvider : "cluster-api:" + capiRelease19 ,
94
+ InitWithBootstrapProviders : []string {"kubeadm:" + capiRelease19 },
95
+ InitWithControlPlaneProviders : []string {"kubeadm:" + capiRelease19 },
60
96
MgmtFlavor : shared .FlavorDefault ,
61
- WorkloadFlavor : shared .FlavorWithoutORC ,
97
+ WorkloadFlavor : shared .FlavorDefault ,
62
98
InitWithKubernetesVersion : e2eCtx .E2EConfig .MustGetVariable (shared .KubernetesVersion ),
63
99
}
64
100
})
0 commit comments