Skip to content

Commit 88f1197

Browse files
committed
Fix #182. Increase the size of bufio.Scanner.Buffer to 10MiB.
1 parent 21cd808 commit 88f1197

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

manifest/parse.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ func ParseRelease(release *release.Release, includeTests bool) map[string]*Mappi
8484

8585
// Parse parses manifest strings into MappingResult
8686
func Parse(manifest string, defaultNamespace string, excludedHooks ...string) map[string]*MappingResult {
87-
// ensure we have a newline in front of the yaml seperator
87+
// Ensure we have a newline in front of the yaml seperator
8888
scanner := bufio.NewScanner(strings.NewReader("\n" + manifest))
8989
scanner.Split(scanYamlSpecs)
90-
//Allow for tokens (specs) up to 1M in size
91-
scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), 1048576)
92-
//Discard the first result, we only care about everything after the first separator
90+
// Allow for tokens (specs) up to 10MiB in size
91+
scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), 10485760)
92+
// Discard the first result, we only care about everything after the first separator
9393
scanner.Scan()
9494

9595
result := make(map[string]*MappingResult)
@@ -104,8 +104,8 @@ func Parse(manifest string, defaultNamespace string, excludedHooks ...string) ma
104104
log.Fatalf("YAML unmarshal error: %s\nCan't unmarshal %s", err, content)
105105
}
106106

107-
//Skip content without any metadata. It is probably a template that
108-
//only contains comments in the current state.
107+
// Skip content without any metadata. It is probably a template that
108+
// only contains comments in the current state.
109109
if parsedMetadata.APIVersion == "" && parsedMetadata.Kind == "" {
110110
continue
111111
}

0 commit comments

Comments
 (0)