From d0bd7754773a72fec47836df21c1ea3e3a655613 Mon Sep 17 00:00:00 2001 From: Ethan Date: Wed, 14 Dec 2022 15:45:39 -0500 Subject: [PATCH] remove leading v from version in TestHelper (#29) * remove leading v from version * add changelog * comments on struct fields --- changelog/v0.1.4/leading_v.yaml | 5 +++++ testutils/helper/install.go | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 changelog/v0.1.4/leading_v.yaml diff --git a/changelog/v0.1.4/leading_v.yaml b/changelog/v0.1.4/leading_v.yaml new file mode 100644 index 0000000..a53e62c --- /dev/null +++ b/changelog/v0.1.4/leading_v.yaml @@ -0,0 +1,5 @@ +changelog: + - type: FIX + issueLink: https://github.com/solo-io/solo-projects/issues/4191 + resolvesIssue: false + description: Remove the leading "v" in chart version value when installing released versions of gloo. diff --git a/testutils/helper/install.go b/testutils/helper/install.go index 0343aa2..110162c 100644 --- a/testutils/helper/install.go +++ b/testutils/helper/install.go @@ -56,12 +56,12 @@ type TestConfig struct { LicenseKey string // Determines whether the test runner pod gets deployed DeployTestRunner bool - // Install a released version of gloo + // Install a released version of gloo. This is the value of the github tag that may have a leading 'v' ReleasedVersion string // If true, glooctl will be run with a -v flag Verbose bool - // The version of the Helm chart + // The version of the Helm chart. Calculated from either the chart or the released version. It will not have a leading 'v' version string } @@ -93,7 +93,12 @@ func NewSoloTestHelper(configFunc TestConfigFunc) (*SoloTestHelper, error) { } testConfig.version = version } else { - testConfig.version = testConfig.ReleasedVersion + // we use the version field as a chart version and tests assume it doesn't have a leading 'v' + if testConfig.ReleasedVersion[0] == 'v' { + testConfig.version = testConfig.ReleasedVersion[1:] + } else { + testConfig.version = testConfig.ReleasedVersion + } } // Default the install namespace to the chart version. // Currently the test chart version built in CI contains the build id, so the namespace will be unique).