Skip to content

Commit

Permalink
test(helm): fix chart replacement in goldenfile test
Browse files Browse the repository at this point in the history
  • Loading branch information
swiatekm committed Nov 3, 2023
1 parent 1dbd952 commit 9c86d42
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/helm/goldenfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@ func runGoldenFileTest(t *testing.T, valuesFileName string, outputFileName strin
// expected templates
func fixupRenderedYaml(yaml string, chartVersion string) string {
checksumRegex := regexp.MustCompile("checksum/config: [a-z0-9]{64}")
chartsRegex := regexp.MustCompile("([^kubernetes-setup:])" + chartVersion)
output := yaml
output = strings.ReplaceAll(output, releaseName, "RELEASE-NAME")
output = chartsRegex.ReplaceAllString(output, "$1%CURRENT_CHART_VERSION%")
output = strings.ReplaceAll(output, chartVersion, "%CURRENT_CHART_VERSION%")
output = checksumRegex.ReplaceAllLiteralString(output, "checksum/config: '%CONFIG_CHECKSUM%'")
output = strings.TrimSuffix(output, "\n")
return output
Expand Down

0 comments on commit 9c86d42

Please sign in to comment.