mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-24 12:17:01 +00:00
set max resource size
This commit is contained in:
parent
7d9bb98a35
commit
905f5e7417
1 changed files with 3 additions and 0 deletions
|
|
@ -77,6 +77,9 @@ func FromFiles(ctx context.Context, ignoreFilePatterns []string, paths ...string
|
||||||
}
|
}
|
||||||
|
|
||||||
scanner := bufio.NewScanner(f)
|
scanner := bufio.NewScanner(f)
|
||||||
|
const maxResourceSize = 4 * 1024 * 1024 // 4MB ought to be enough for everybody
|
||||||
|
buf := make([]byte, maxResourceSize)
|
||||||
|
scanner.Buffer(buf, maxResourceSize)
|
||||||
scanner.Split(SplitYAMLDocument)
|
scanner.Split(SplitYAMLDocument)
|
||||||
nRes := 0
|
nRes := 0
|
||||||
for res := scanner.Scan(); res != false; res = scanner.Scan() {
|
for res := scanner.Scan(); res != false; res = scanner.Scan() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue