Skip to content

Commit

Permalink
Merge pull request #570 from yiannistri/fix-e2e-rancher-version
Browse files Browse the repository at this point in the history
[v2.9] fix: Use version v2.9-head of Rancher for e2e tests
  • Loading branch information
yiannistri authored Jun 26, 2024
2 parents f39cfdf + 0ab1ef4 commit 5fdc329
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion test/e2e/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ certManagerVersion: v1.9.2
certManagerChartURL: https://charts.jetstack.io/charts/cert-manager-${CERT_MANAGER_VERSION}.tgz

rancherVersion: v2.9-head
rancherChartURL: https://releases.rancher.com/server-charts/latest/rancher-${RANCHER_VERSION}.tgz
# Install the latest chart from the rancher repo but override the image tag
rancherChartURL: https://releases.rancher.com/server-charts/latest/
27 changes: 23 additions & 4 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var _ = BeforeSuite(func() {
Expect(err).ToNot(HaveOccurred())

By("Deploying rancher and cert-manager", func() {
By("installing cert-manager", func() {
By("Installing cert-manager", func() {
if isDeploymentReady(certManagerNamespace, certManagerName) {
By("already installed")
} else {
Expand All @@ -134,14 +134,31 @@ var _ = BeforeSuite(func() {
}
})

By("installing rancher", func() {
By("Adding rancher helm chart repository", func() {
Expect(kubectl.RunHelmBinaryWithCustomErr(
"repo",
"add",
"--force-update",
"rancher-latest",
fmt.Sprintf(e2eCfg.RancherChartURL),
)).To(Succeed())
})

By("Update helm repositories", func() {
Expect(kubectl.RunHelmBinaryWithCustomErr(
"repo",
"update",
)).To(Succeed())
})

By("Installing rancher", func() {
if isDeploymentReady(cattleSystemNamespace, rancherName) {
By("already installed")
} else {
Expect(kubectl.RunHelmBinaryWithCustomErr(
"install",
"-n",
cattleSystemNamespace,
"install",
"--set",
"bootstrapPassword=admin",
"--set",
Expand All @@ -154,8 +171,10 @@ var _ = BeforeSuite(func() {
"global.cattle.psp.enabled=false",
"--set", fmt.Sprintf("hostname=%s.%s", e2eCfg.ExternalIP, e2eCfg.MagicDNS),
"--create-namespace",
"--devel",
"--set", fmt.Sprintf("rancherImageTag=%s", e2eCfg.RancherVersion),
rancherName,
fmt.Sprintf(e2eCfg.RancherChartURL),
"rancher-latest/rancher",
)).To(Succeed())
Eventually(func() bool {
return isDeploymentReady(cattleSystemNamespace, rancherName)
Expand Down

0 comments on commit 5fdc329

Please sign in to comment.