Skip to content

Commit

Permalink
Bump CAPI versions (min=v1.7.7, max=v1.8.0) in E2E
Browse files Browse the repository at this point in the history
Signed-off-by: Furkat Gofurov <[email protected]>
  • Loading branch information
furkatgofurov7 committed Nov 11, 2024
1 parent 2807b27 commit 86dba88
Show file tree
Hide file tree
Showing 15 changed files with 27,106 additions and 21,688 deletions.
14 changes: 7 additions & 7 deletions cmd/plugin/cmd/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,22 @@ func TestInitProviders(t *testing.T) {
{
name: "core provider",
wantedProviders: []genericprovider.GenericProvider{
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-system", "v1.6.0", "", ""),
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-system", "v1.8.0", "", ""),
},
wantErr: false,
opts: &initOptions{
coreProvider: "cluster-api:capi-system:v1.6.0",
coreProvider: "cluster-api:capi-system:v1.8.0",
targetNamespace: "capi-operator-system",
},
},
{
name: "core provider in default target namespace",
wantedProviders: []genericprovider.GenericProvider{
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-operator-system", "v1.6.0", "", ""),
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-operator-system", "v1.8.0", "", ""),
},
wantErr: false,
opts: &initOptions{
coreProvider: "cluster-api::v1.6.0",
coreProvider: "cluster-api::v1.8.0",
targetNamespace: "capi-operator-system",
},
},
Expand Down Expand Up @@ -254,7 +254,7 @@ func TestInitProviders(t *testing.T) {
{
name: "all providers",
wantedProviders: []genericprovider.GenericProvider{
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-system", "v1.6.0", "", ""),
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-system", "v1.8.0", "", ""),
generateGenericProvider(clusterctlv1.InfrastructureProviderType, "aws", "capa-operator-system", "", "", ""),
generateGenericProvider(clusterctlv1.InfrastructureProviderType, "docker", "capd-operator-system", "", "", ""),
generateGenericProvider(clusterctlv1.ControlPlaneProviderType, "kubeadm", "kcp-system", "", "", ""),
Expand All @@ -263,9 +263,9 @@ func TestInitProviders(t *testing.T) {
},
wantErr: false,
opts: &initOptions{
coreProvider: "cluster-api:capi-system:v1.6.0",
coreProvider: "cluster-api:capi-system:v1.8.0",
infrastructureProviders: []string{
"cluster-api:capi-system:v1.6.0",
"cluster-api:capi-system:v1.8.0",
"aws:capa-operator-system",
"docker:capd-operator-system",
},
Expand Down
12 changes: 6 additions & 6 deletions cmd/plugin/cmd/upgrade_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ func TestUpgradePlan(t *testing.T) {
Name: "cluster-api",
Namespace: "capi-system",
Type: "core",
CurrentVersion: "v1.6.0",
CurrentVersion: "v1.8.0",
Source: "https://github.com/kubernetes-sigs/cluster-api/releases/latest/core-components.yaml",
SourceType: providerSourceTypeBuiltin,
},
},
},
wantedProviders: []genericprovider.GenericProvider{
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-system", "v1.6.0", "", ""),
generateGenericProvider(clusterctlv1.CoreProviderType, "cluster-api", "capi-system", "v1.8.0", "", ""),
},
wantErr: false,
opts: &initOptions{
coreProvider: "cluster-api:capi-system:v1.6.0",
coreProvider: "cluster-api:capi-system:v1.8.0",
targetNamespace: "capi-operator-system",
},
},
Expand All @@ -80,18 +80,18 @@ func TestUpgradePlan(t *testing.T) {
Name: "docker",
Namespace: "capi-system",
Type: "infrastructure",
CurrentVersion: "v1.6.0",
CurrentVersion: "v1.8.0",
Source: "https://github.com/kubernetes-sigs/cluster-api/releases/latest/core-components.yaml",
SourceType: providerSourceTypeCustomURL,
},
},
},
wantedProviders: []genericprovider.GenericProvider{
generateGenericProvider(clusterctlv1.InfrastructureProviderType, "docker", "capi-system", "v1.6.0", "", ""),
generateGenericProvider(clusterctlv1.InfrastructureProviderType, "docker", "capi-system", "v1.8.0", "", ""),
},
wantErr: false,
opts: &initOptions{
infrastructureProviders: []string{"docker:capi-system:v1.6.0"},
infrastructureProviders: []string{"docker:capi-system:v1.8.0"},
targetNamespace: "capi-operator-system",
},
},
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/air_gapped_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = Describe("Install Core Provider in an air-gapped environment", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
configMaps := []corev1.ConfigMap{}

for _, fileName := range []string{"core-cluster-api-v1.5.4.yaml", "core-cluster-api-v1.6.0.yaml"} {
for _, fileName := range []string{"core-cluster-api-v1.7.7.yaml", "core-cluster-api-v1.8.0.yaml"} {
coreProviderComponents, err := os.ReadFile(customManifestsFolder + fileName)
Expect(err).ToNot(HaveOccurred(), "Failed to read the core provider manifests file")

Expand Down Expand Up @@ -85,7 +85,7 @@ var _ = Describe("Install Core Provider in an air-gapped environment", func() {
},
},
},
Version: "v1.5.4",
Version: "v1.7.7",
},
},
}
Expand All @@ -109,7 +109,7 @@ var _ = Describe("Install Core Provider in an air-gapped environment", func() {
}), e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
})

It("should successfully upgrade a CoreProvider (v1.5.4 -> latest)", func() {
It("should successfully upgrade a CoreProvider (v1.7.7 -> latest)", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
coreProvider := &operatorv1.CoreProvider{}
key := client.ObjectKey{Namespace: capiSystemNamespace, Name: coreProviderName}
Expand Down Expand Up @@ -161,7 +161,7 @@ var _ = Describe("Install Core Provider in an air-gapped environment", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
configMaps := []corev1.ConfigMap{}

for _, fileName := range []string{"core-cluster-api-v1.5.4.yaml", "core-cluster-api-v1.6.0.yaml"} {
for _, fileName := range []string{"core-cluster-api-v1.7.7.yaml", "core-cluster-api-v1.8.0.yaml"} {
coreProviderComponents, err := os.ReadFile(customManifestsFolder + fileName)
Expect(err).ToNot(HaveOccurred(), "Failed to read the core provider manifests file")

Expand Down
22 changes: 11 additions & 11 deletions test/e2e/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
manifests, err := helmChart.Run(map[string]string{
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"core": "capi-custom-ns:cluster-api:v1.5.4",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.5.4",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.5.4",
"infrastructure": "capd-custom-ns:docker:v1.5.4",
"core": "capi-custom-ns:cluster-api:v1.7.7",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.7.7",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.7.7",
"infrastructure": "capd-custom-ns:docker:v1.7.7",
"addon": "helm-custom-ns:helm:v0.1.0-alpha.9",
})
Expect(err).ToNot(HaveOccurred())
Expand All @@ -72,10 +72,10 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
manifests, err := helmChart.Run(map[string]string{
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"core": "cluster-api:v1.5.4",
"controlPlane": "kubeadm:v1.5.4",
"bootstrap": "kubeadm:v1.5.4",
"infrastructure": "docker:v1.5.4",
"core": "cluster-api:v1.7.7",
"controlPlane": "kubeadm:v1.7.7",
"bootstrap": "kubeadm:v1.7.7",
"infrastructure": "docker:v1.7.7",
"addon": "helm:v0.1.0-alpha.9",
})
Expect(err).ToNot(HaveOccurred())
Expand Down Expand Up @@ -145,7 +145,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
manifests, err := helmChart.Run(map[string]string{
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"infrastructure": "capd-custom-ns:docker:v1.5.4;capz-custom-ns:azure:v1.10.0",
"infrastructure": "capd-custom-ns:docker:v1.7.7;capz-custom-ns:azure:v1.10.0",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -158,7 +158,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
manifests, err := helmChart.Run(map[string]string{
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.5.4;rke2-control-plane-custom-ns:rke2:v0.3.0",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.7.7;rke2-control-plane-custom-ns:rke2:v0.3.0",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand All @@ -171,7 +171,7 @@ var _ = Describe("Create a proper set of manifests when using helm charts", func
manifests, err := helmChart.Run(map[string]string{
"configSecret.name": "test-secret-name",
"configSecret.namespace": "test-secret-namespace",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.5.4;rke2-bootstrap-custom-ns:rke2:v0.3.0",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.7.7;rke2-bootstrap-custom-ns:rke2:v0.3.0",
})
Expect(err).ToNot(HaveOccurred())
Expect(manifests).ToNot(BeEmpty())
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
operatorNamespace = "capi-operator-system"
capiSystemNamespace = "capi-system"

previousCAPIVersion = "v1.5.4"
previousCAPIVersion = "v1.7.7"

coreProviderName = "cluster-api"
coreProviderDeploymentName = "capi-controller-manager"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/minimal_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ metadata:
e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
})

It("should successfully upgrade a CoreProvider (v1.5.4 -> latest)", func() {
It("should successfully upgrade a CoreProvider (v1.7.7 -> latest)", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
coreProvider := &operatorv1.CoreProvider{ObjectMeta: metav1.ObjectMeta{
Name: coreProviderName,
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/resources/all-providers-custom-ns-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ metadata:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -84,7 +84,7 @@ metadata:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -100,7 +100,7 @@ metadata:
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -116,7 +116,7 @@ metadata:
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
8 changes: 4 additions & 4 deletions test/e2e/resources/all-providers-custom-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ metadata:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -84,7 +84,7 @@ metadata:
"helm.sh/hook": "post-install,post-upgrade"
"helm.sh/hook-weight": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -100,7 +100,7 @@ metadata:
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -116,7 +116,7 @@ metadata:
"helm.sh/hook-weight": "2"
"argocd.argoproj.io/sync-wave": "2"
spec:
version: v1.5.4
version: v1.7.7
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Loading

0 comments on commit 86dba88

Please sign in to comment.