Skip to content

Commit

Permalink
fix(ci) ensure helm repo is present for compatibility tests (#2861) (#…
Browse files Browse the repository at this point in the history
…2868)

The e2e compatibility tests use helm to install an older version of
Kuma using helm. That means that we need to ensure that the Kuma helm
repository is added and updated, even if there are side-effects on the
test execution environment.

This fixes #2853.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit fb7b5a0)

Co-authored-by: James Peach <james.peach@konghq.com>
  • Loading branch information
mergify[bot] and jpeach authored Oct 4, 2021
1 parent 3bdcab3 commit 377dee3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/e2e/compatibility/cp_compatibility_kubernetes_multizone.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"
"time"

"github.com/gruntwork-io/terratest/modules/helm"
"github.com/gruntwork-io/terratest/modules/k8s"
"github.com/gruntwork-io/terratest/modules/random"
. "github.com/onsi/ginkgo"
Expand All @@ -26,6 +27,24 @@ func CpCompatibilityMultizoneKubernetes() {
var zoneDeployOptsFuncs = KumaZoneK8sDeployOpts
var zoneReleaseName string

// Ensure that the upstream Kuma help repository is configured
// and refreshed. This is needed for helm to be able to pull the
// OldChart version of the Kuma helm chart.
BeforeSuite(func() {
t := NewTestingT()
opts := helm.Options{}

// Adding the same repo multiple times is idempotent. The
// `--force-update` flag prevents heml emitting an error
// in this case.
_, err := helm.RunHelmCommandAndGetOutputE(t, &opts,
"repo", "add", "--force-update", "kuma", "https://kumahq.github.io/charts")
Expect(err).To(Succeed())

_, err = helm.RunHelmCommandAndGetOutputE(t, &opts, "repo", "update")
Expect(err).To(Succeed())
})

BeforeEach(func() {
// Global CP
c, err := NewK8sClusterWithTimeout(
Expand Down

0 comments on commit 377dee3

Please sign in to comment.