Skip to content

Commit

Permalink
remove leading v from version in TestHelper (#29)
Browse files Browse the repository at this point in the history
* remove leading v from version

* add changelog

* comments on struct fields
  • Loading branch information
elcasteel authored Dec 14, 2022
1 parent ed991ec commit d0bd775
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/v0.1.4/leading_v.yaml
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 8 additions & 3 deletions testutils/helper/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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).
Expand Down

0 comments on commit d0bd775

Please sign in to comment.