Skip to content

Commit

Permalink
Merge pull request #398 from furkatgofurov7/separate-legacy-upgrade-t…
Browse files Browse the repository at this point in the history
…ests

Drop out legacy and add default upgrade e2e tests
  • Loading branch information
alexander-demicev authored Aug 13, 2024
2 parents 480a96d + ec2b27b commit 125d6b8
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 409 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Build e2e image
run: make e2e-image
- name: Setup kind
uses: helm/kind-action@v1.9.0
with:
Expand Down
49 changes: 0 additions & 49 deletions test/e2e/config/e2e_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ providers:
contract: v1beta1
files:
- sourcePath: "../data/infrastructure/cluster-template-docker.yaml"
- sourcePath: "../data/infrastructure/cluster-template-docker-legacy.yaml"
- sourcePath: "../data/shared/v1beta1/metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
Expand All @@ -52,30 +51,6 @@ providers:
- name: rke2-control-plane
type: ControlPlaneProvider
versions:
- name: "v0.2.7"
value: "https://github.com/rancher/cluster-api-provider-rke2/releases/download/v0.2.7/control-plane-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../../../metadata.yaml"
targetName: "metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- old: "--leader-elect"
new: "--leader-elect=false"
- name: "v0.3.0"
value: "https://github.com/rancher/cluster-api-provider-rke2/releases/download/v0.3.0/control-plane-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../../../metadata.yaml"
targetName: "metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- old: "--leader-elect"
new: "--leader-elect=false"
- name: "v0.4.0"
value: "https://github.com/rancher/cluster-api-provider-rke2/releases/download/v0.4.0/control-plane-components.yaml"
type: "url"
Expand Down Expand Up @@ -114,30 +89,6 @@ providers:
- name: rke2-bootstrap
type: BootstrapProvider
versions:
- name: "v0.2.7"
value: "https://github.com/rancher/cluster-api-provider-rke2/releases/download/v0.2.7/bootstrap-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../../../metadata.yaml"
targetName: "metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- old: "--leader-elect"
new: "--leader-elect=false"
- name: "v0.3.0"
value: "https://github.com/rancher/cluster-api-provider-rke2/releases/download/v0.3.0/bootstrap-components.yaml"
type: "url"
contract: v1beta1
files:
- sourcePath: "../../../metadata.yaml"
targetName: "metadata.yaml"
replacements:
- old: "imagePullPolicy: Always"
new: "imagePullPolicy: IfNotPresent"
- old: "--leader-elect"
new: "--leader-elect=false"
- name: "v0.4.0"
value: "https://github.com/rancher/cluster-api-provider-rke2/releases/download/v0.4.0/bootstrap-components.yaml"
type: "url"
Expand Down
171 changes: 0 additions & 171 deletions test/e2e/data/infrastructure/cluster-template-docker-legacy.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion test/e2e/data/infrastructure/cluster-template-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ metadata:
spec:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
version: ${KUBERNETES_VERSION}+rke2r1
registrationMethod: internal-first
registrationMethod: control-plane-endpoint
rolloutStrategy:
type: "RollingUpdate"
rollingUpdate:
Expand Down
13 changes: 8 additions & 5 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,28 +234,31 @@ func setupBootstrapCluster(config *clusterctl.E2EConfig, scheme *runtime.Scheme,
return clusterProvider, clusterProxy
}

// initBootstrapCluster initializes a bootstrap cluster with the latest minor version.
func initBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *clusterctl.E2EConfig, clusterctlConfig, artifactFolder string) {
clusterctl.InitManagementClusterAndWatchControllerLogs(context.TODO(), clusterctl.InitManagementClusterAndWatchControllerLogsInput{
ClusterProxy: bootstrapClusterProxy,
ClusterctlConfigPath: clusterctlConfig,
InfrastructureProviders: config.InfrastructureProviders(),
IPAMProviders: config.IPAMProviders(),
RuntimeExtensionProviders: config.RuntimeExtensionProviders(),
BootstrapProviders: []string{"rke2-bootstrap:v0.5.0"},
ControlPlaneProviders: []string{"rke2-control-plane:v0.5.0"},
BootstrapProviders: []string{"rke2-bootstrap"},
ControlPlaneProviders: []string{"rke2-control-plane"},
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
}, config.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
}

func initLegacyBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *clusterctl.E2EConfig, clusterctlConfig, artifactFolder string) {
// initUpgradableBootstrapCluster initializes a bootstrap cluster with the latest minor version N-1 and used to perform an upgrade to the latest version.
// Make sure to update the version in the providers list to the latest minor version N-1.
func initUpgradableBootstrapCluster(bootstrapClusterProxy framework.ClusterProxy, config *clusterctl.E2EConfig, clusterctlConfig, artifactFolder string) {
clusterctl.InitManagementClusterAndWatchControllerLogs(context.TODO(), clusterctl.InitManagementClusterAndWatchControllerLogsInput{
ClusterProxy: bootstrapClusterProxy,
ClusterctlConfigPath: clusterctlConfig,
InfrastructureProviders: config.InfrastructureProviders(),
IPAMProviders: config.IPAMProviders(),
RuntimeExtensionProviders: config.RuntimeExtensionProviders(),
BootstrapProviders: []string{"rke2-bootstrap:v0.2.7"},
ControlPlaneProviders: []string{"rke2-control-plane:v0.2.7"},
BootstrapProviders: []string{"rke2-bootstrap:v0.4.0"},
ControlPlaneProviders: []string{"rke2-control-plane:v0.4.0"},
LogFolder: filepath.Join(artifactFolder, "clusters", bootstrapClusterProxy.GetName()),
}, config.GetIntervals(bootstrapClusterProxy.GetName(), "wait-controllers")...)
}
Expand Down
Loading

0 comments on commit 125d6b8

Please sign in to comment.