Skip to content

Commit

Permalink
Removed comments and replaced %s with %q
Browse files Browse the repository at this point in the history
  • Loading branch information
harshshahsumo committed Jul 11, 2024
1 parent cd83f9d commit 61bdf08
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/helm/goldenfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,13 @@ 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}")
// replacements := map[string]string{
// fmt.Sprintf("app.kubernetes.io/version: \"%s\"", chartVersion): "app.kubernetes.io/version: \"%CURRENT_CHART_VERSION%\"",
// fmt.Sprintf("chart: \"sumologic-%s\"", chartVersion): "chart: \"sumologic-%CURRENT_CHART_VERSION%\"",
// fmt.Sprintf("chart: sumologic-%s", chartVersion): "chart: sumologic-%CURRENT_CHART_VERSION%",
// fmt.Sprintf("client: k8s_%s", chartVersion): "client: k8s_%CURRENT_CHART_VERSION%",
// fmt.Sprintf("value: \"%s\"", chartVersion): "value: \"%CURRENT_CHART_VERSION%\"",
// }

replacements := []string{
"app.kubernetes.io/version: \"%s\"",
"app.kubernetes.io/version: %q",
"chart: \"sumologic-%s\"",
"chart: sumologic-%s",
"client: k8s_%s",
"value: \"%s\"",
"value: %q",
}
output := yaml
output = strings.ReplaceAll(output, releaseName, "RELEASE-NAME")
Expand Down

0 comments on commit 61bdf08

Please sign in to comment.