aboutsummaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go b/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
index a9a3853ac..492171faf 100644
--- a/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
+++ b/vendor/k8s.io/apimachinery/pkg/util/yaml/decoder.go
@@ -26,7 +26,7 @@ import (
"strings"
"unicode"
- "k8s.io/klog"
+ "k8s.io/klog/v2"
"sigs.k8s.io/yaml"
)
@@ -92,6 +92,10 @@ type YAMLDecoder struct {
// the caller in framing the chunk.
func NewDocumentDecoder(r io.ReadCloser) io.ReadCloser {
scanner := bufio.NewScanner(r)
+ // the size of initial allocation for buffer 4k
+ buf := make([]byte, 4*1024)
+ // the maximum size used to buffer a token 5M
+ scanner.Buffer(buf, 5*1024*1024)
scanner.Split(splitYAMLDocument)
return &YAMLDecoder{
r: r,