Skip to content

Commit

Permalink
Allow long lines in YAML specs (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin authored Nov 1, 2024
1 parent d9c6389 commit 472ea24
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/util/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 472ea24

Please sign in to comment.