Skip to content

Commit

Permalink
Bump CAPI version in E2E
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-demicev committed Dec 18, 2023
1 parent b2128fc commit 4b093b2
Show file tree
Hide file tree
Showing 12 changed files with 2,902 additions and 4,738 deletions.
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.4.2.yaml", "core-cluster-api-v1.4.3.yaml"} {
for _, fileName := range []string{"core-cluster-api-v1.5.4.yaml", "core-cluster-api-v1.6.0.yaml"} {
coreProviderComponents, err := os.ReadFile(customManifestsFolder + fileName)
Expect(err).ToNot(HaveOccurred(), "Failed to read the core provider manifests file")

Expand Down Expand Up @@ -77,7 +77,7 @@ var _ = Describe("Install Core Provider in an air-gapped environment", func() {
},
},
},
Version: "v1.4.2",
Version: "v1.5.4",
},
},
}
Expand All @@ -101,7 +101,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.4.2 -> latest)", func() {
It("should successfully upgrade a CoreProvider (v1.5.4 -> latest)", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
coreProvider := &operatorv1.CoreProvider{}
key := client.ObjectKey{Namespace: operatorNamespace, Name: coreProviderName}
Expand Down Expand Up @@ -153,7 +153,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.4.2.yaml", "core-cluster-api-v1.4.3.yaml"} {
for _, fileName := range []string{"core-cluster-api-v1.5.4.yaml", "core-cluster-api-v1.6.0.yaml"} {
coreProviderComponents, err := os.ReadFile(customManifestsFolder + fileName)
Expect(err).ToNot(HaveOccurred(), "Failed to read the core provider manifests file")

Expand Down
34 changes: 18 additions & 16 deletions test/e2e/compressed_manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
operatorv1alpha1 "sigs.k8s.io/cluster-api-operator/api/v1alpha1"
operatorv1 "sigs.k8s.io/cluster-api-operator/api/v1alpha2"
"sigs.k8s.io/cluster-api/test/framework"

"k8s.io/utils/ptr"
Expand All @@ -49,10 +49,12 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

It("should successfully create a CoreProvider", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
coreProvider := &operatorv1alpha1.CoreProvider{ObjectMeta: metav1.ObjectMeta{
Name: coreProviderName,
Namespace: operatorNamespace,
}}
coreProvider := &operatorv1.CoreProvider{
ObjectMeta: metav1.ObjectMeta{
Name: coreProviderName,
Namespace: operatorNamespace,
},
}
Expect(bootstrapCluster.Create(ctx, coreProvider)).To(Succeed())

By("Waiting for the core provider deployment to be ready")
Expand All @@ -63,7 +65,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

By("Waiting for core provider to be ready")
WaitFor(ctx, For(coreProvider).In(bootstrapCluster).ToSatisfy(
HaveStatusCondition(&coreProvider.Status.Conditions, operatorv1alpha1.ProviderInstalledCondition),
HaveStatusCondition(&coreProvider.Status.Conditions, operatorv1.ProviderInstalledCondition),
), e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Waiting for status.IntalledVersion to be set")
Expand All @@ -74,13 +76,13 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

It("should successfully create and delete an InfrastructureProvider for OCI", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
infraProvider := &operatorv1alpha1.InfrastructureProvider{
infraProvider := &operatorv1.InfrastructureProvider{
ObjectMeta: metav1.ObjectMeta{
Name: ociInfrastructureProviderName,
Namespace: operatorNamespace,
},
Spec: operatorv1alpha1.InfrastructureProviderSpec{
ProviderSpec: operatorv1alpha1.ProviderSpec{
Spec: operatorv1.InfrastructureProviderSpec{
ProviderSpec: operatorv1.ProviderSpec{
Version: ociInfrastructureProviderVersion,
},
},
Expand All @@ -90,7 +92,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

By("Waiting for the infrastructure provider to be ready")
WaitFor(ctx, For(infraProvider).In(bootstrapCluster).ToSatisfy(
HaveStatusCondition(&infraProvider.Status.Conditions, operatorv1alpha1.ProviderInstalledCondition),
HaveStatusCondition(&infraProvider.Status.Conditions, operatorv1.ProviderInstalledCondition),
), e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Waiting for status.IntalledVersion to be set")
Expand Down Expand Up @@ -134,14 +136,14 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

It("should successfully create and delete an InfrastructureProvider for OCI with custom name from a pre-created ConfigMap", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
infraProvider := &operatorv1alpha1.InfrastructureProvider{
infraProvider := &operatorv1.InfrastructureProvider{
ObjectMeta: metav1.ObjectMeta{
Name: ociInfrastructureProviderCustomName,
Namespace: operatorNamespace,
},
Spec: operatorv1alpha1.InfrastructureProviderSpec{
ProviderSpec: operatorv1alpha1.ProviderSpec{
FetchConfig: &operatorv1alpha1.FetchConfiguration{
Spec: operatorv1.InfrastructureProviderSpec{
ProviderSpec: operatorv1.ProviderSpec{
FetchConfig: &operatorv1.FetchConfiguration{
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{
"provider.cluster.x-k8s.io/name": "oci",
Expand All @@ -163,7 +165,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

By("Waiting for the infrastructure provider to be ready")
WaitFor(ctx, For(infraProvider).In(bootstrapCluster).ToSatisfy(
HaveStatusCondition(&infraProvider.Status.Conditions, operatorv1alpha1.ProviderInstalledCondition)),
HaveStatusCondition(&infraProvider.Status.Conditions, operatorv1.ProviderInstalledCondition)),
e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)

By("Waiting for status.IntalledVersion to be set")
Expand Down Expand Up @@ -199,7 +201,7 @@ var _ = Describe("Create and delete a provider with manifests that don't fit the

It("should successfully delete a CoreProvider", func() {
bootstrapCluster := bootstrapClusterProxy.GetClient()
coreProvider := &operatorv1alpha1.CoreProvider{ObjectMeta: metav1.ObjectMeta{
coreProvider := &operatorv1.CoreProvider{ObjectMeta: metav1.ObjectMeta{
Name: coreProviderName,
Namespace: operatorNamespace,
}}
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.4.2",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.4.2",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.4.2",
"infrastructure": "capd-custom-ns:docker:v1.4.2",
"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",
"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.4.2",
"controlPlane": "kubeadm:v1.4.2",
"bootstrap": "kubeadm:v1.4.2",
"infrastructure": "docker:v1.4.2",
"core": "cluster-api:v1.5.4",
"controlPlane": "kubeadm:v1.5.4",
"bootstrap": "kubeadm:v1.5.4",
"infrastructure": "docker:v1.5.4",
"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.4.2;capz-custom-ns:azure:v1.10.0",
"infrastructure": "capd-custom-ns:docker:v1.5.4;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.4.2;rke2-control-plane-custom-ns:rke2:v0.3.0",
"controlPlane": "kubeadm-control-plane-custom-ns:kubeadm:v1.5.4;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.4.2;rke2-bootstrap-custom-ns:rke2:v0.3.0",
"bootstrap": "kubeadm-bootstrap-custom-ns:kubeadm:v1.5.4;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 @@ -30,7 +30,7 @@ var (
const (
operatorNamespace = "capi-operator-system"

previousCAPIVersion = "v1.4.2"
previousCAPIVersion = "v1.5.4"

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 @@ -267,7 +267,7 @@ metadata:
e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
})

It("should successfully upgrade a CoreProvider (v1.4.2 -> latest)", func() {
It("should successfully upgrade a CoreProvider (v1.5.4 -> 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 @@ -66,7 +66,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -81,7 +81,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -96,7 +96,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -111,7 +111,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
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 @@ -66,7 +66,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -81,7 +81,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -96,7 +96,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Expand All @@ -111,7 +111,7 @@ metadata:
"helm.sh/hook": "post-install"
"helm.sh/hook-weight": "2"
spec:
version: v1.4.2
version: v1.5.4
configSecret:
name: test-secret-name
namespace: test-secret-namespace
Loading

0 comments on commit 4b093b2

Please sign in to comment.