From 472ea24b7963df838ea6836fba841fdc762727ed Mon Sep 17 00:00:00 2001 From: Dmitriy Ivolgin Date: Fri, 1 Nov 2024 13:38:27 -0700 Subject: [PATCH] Allow long lines in YAML specs (#189) --- pkg/util/text.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/util/text.go b/pkg/util/text.go index 151fb37..ca42cc7 100644 --- a/pkg/util/text.go +++ b/pkg/util/text.go @@ -232,6 +232,11 @@ func CleanUpYaml(value string) string { lines := []string{} scanner := bufio.NewScanner(strings.NewReader(value)) + // Accomodate long lines that can be embedded in secrets and configmaps + const maxCapacity = 1024 * 1024 // 1MB + buf := make([]byte, 0, maxCapacity) + scanner.Buffer(buf, maxCapacity) + for scanner.Scan() { line := scanner.Text() if IsLineEmpty(line) {