Skip to content

Commit

Permalink
Remove legacy tests and related code
Browse files Browse the repository at this point in the history
Signed-off-by: Furkat Gofurov <[email protected]>
(cherry picked from commit bc00f06)
  • Loading branch information
furkatgofurov7 committed Aug 13, 2024
1 parent d06653f commit 908dcd2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 407 deletions.
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 908dcd2

Please sign in to comment.