From b6580c263afeb6a63ada9de749d439cf13c9d0ee Mon Sep 17 00:00:00 2001 From: Andrej Krejcir Date: Fri, 19 Nov 2021 10:29:51 +0100 Subject: [PATCH] Fix csv-generator's invalid YAML output csv-generator was doing string operations on YAML document, which could produce invalid YAML. This patch removes these operations. Signed-off-by: Andrej Krejcir --- hack/csv-generator.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hack/csv-generator.go b/hack/csv-generator.go index cf8a3ac0f..e003ab32c 100644 --- a/hack/csv-generator.go +++ b/hack/csv-generator.go @@ -23,7 +23,6 @@ import ( "io" "io/ioutil" "os" - "strings" "github.com/blang/semver/v4" gyaml "github.com/ghodss/yaml" @@ -290,17 +289,6 @@ func marshallObject(obj interface{}, relatedImages []interface{}, writer io.Writ return err } - // fix templates by removing unneeded single quotes... - s := string(yamlBytes) - s = strings.Replace(s, "'{{", "{{", -1) - s = strings.Replace(s, "}}'", "}}", -1) - - // fix double quoted strings by removing unneeded single quotes... - s = strings.Replace(s, " '\"", " \"", -1) - s = strings.Replace(s, "\"'\n", "\"\n", -1) - - yamlBytes = []byte(s) - _, err = writer.Write([]byte("---\n")) if err != nil { return err