From 7eaff968ea7abb50cdd6ef0b8b3ff5bd6dba3665 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 00:07:45 +0000 Subject: [PATCH] fix(deps): update github.com/cilium/tetragon/pkg/k8s digest to dbf8f0c Signed-off-by: renovate[bot] --- go.mod | 4 +-- go.sum | 8 ++--- vendor/github.com/sirupsen/logrus/writer.go | 34 ++++++++++++++++++++- vendor/modules.txt | 4 +-- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index da900983c3..26fbc7e8ac 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cilium/cilium v1.14.0-snapshot.4 github.com/cilium/hubble v0.11.6 github.com/cilium/proxy v0.0.0-20230605062141-384b5008dce4 - github.com/cilium/tetragon/pkg/k8s v0.0.0-20230619094252-e60ba99096db + github.com/cilium/tetragon/pkg/k8s v0.0.0-20230620174403-dbf8f0cfaa52 github.com/cilium/workerpool v1.2.0 github.com/cloudflare/cfssl v1.6.4 github.com/go-openapi/strfmt v0.21.7 @@ -168,7 +168,7 @@ require ( github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil/v3 v3.23.5 // indirect github.com/shopspring/decimal v1.3.1 // indirect - github.com/sirupsen/logrus v1.9.2 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/afero v1.9.5 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect diff --git a/go.sum b/go.sum index 6c1417f289..05ae54c853 100644 --- a/go.sum +++ b/go.sum @@ -119,8 +119,8 @@ github.com/cilium/hubble v0.11.6 h1:QvYOxER5tOPUTX8fILvxHSwkqyCycu8wxKVVUa0x6d0= github.com/cilium/hubble v0.11.6/go.mod h1:pbR0F37lKRo8d9fNVe+oMmOKD67VYkm1gvjq1pVTdkc= github.com/cilium/proxy v0.0.0-20230605062141-384b5008dce4 h1:/xljml3K0NLz0Ml2HOu4aXFXEgDdJHPrj0Me9S6chQ4= github.com/cilium/proxy v0.0.0-20230605062141-384b5008dce4/go.mod h1:ontBl/RX7G0GwcR38YQVp6d75MjIsL1FbBidVpn+F8I= -github.com/cilium/tetragon/pkg/k8s v0.0.0-20230619094252-e60ba99096db h1:OKTA/hhbPvHzC5fsdN7oTBK1sFQJzHPIeQ+dWZQjsX0= -github.com/cilium/tetragon/pkg/k8s v0.0.0-20230619094252-e60ba99096db/go.mod h1:qOTXyxeuKXiha7G6yZPUzrvJ8l7qSrVAxJl1VGBYrkE= +github.com/cilium/tetragon/pkg/k8s v0.0.0-20230620174403-dbf8f0cfaa52 h1:OQUOtY1U5FwD37iPiKLenCdpFd6pWKeLSldCWYGkkzk= +github.com/cilium/tetragon/pkg/k8s v0.0.0-20230620174403-dbf8f0cfaa52/go.mod h1:KNgBXaqmnBIsBodZW7i9g6jRUU1twDBq4hF7xpmWhlg= github.com/cilium/workerpool v1.2.0 h1:Wc2iOPTvCgWKQXeq4L5tnx4QFEI+z5q1+bSpSS0cnAY= github.com/cilium/workerpool v1.2.0/go.mod h1:GOYJhwlnIjR+jWSDNBb5kw47G1H/XA9X4WOBpgr4pQU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -718,8 +718,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= -github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= diff --git a/vendor/github.com/sirupsen/logrus/writer.go b/vendor/github.com/sirupsen/logrus/writer.go index 72e8e3a1b6..074fd4b8bd 100644 --- a/vendor/github.com/sirupsen/logrus/writer.go +++ b/vendor/github.com/sirupsen/logrus/writer.go @@ -4,6 +4,7 @@ import ( "bufio" "io" "runtime" + "strings" ) // Writer at INFO level. See WriterLevel for details. @@ -20,15 +21,18 @@ func (logger *Logger) WriterLevel(level Level) *io.PipeWriter { return NewEntry(logger).WriterLevel(level) } +// Writer returns an io.Writer that writes to the logger at the info log level func (entry *Entry) Writer() *io.PipeWriter { return entry.WriterLevel(InfoLevel) } +// WriterLevel returns an io.Writer that writes to the logger at the given log level func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { reader, writer := io.Pipe() var printFunc func(args ...interface{}) + // Determine which log function to use based on the specified log level switch level { case TraceLevel: printFunc = entry.Trace @@ -48,23 +52,51 @@ func (entry *Entry) WriterLevel(level Level) *io.PipeWriter { printFunc = entry.Print } + // Start a new goroutine to scan the input and write it to the logger using the specified print function. + // It splits the input into chunks of up to 64KB to avoid buffer overflows. go entry.writerScanner(reader, printFunc) + + // Set a finalizer function to close the writer when it is garbage collected runtime.SetFinalizer(writer, writerFinalizer) return writer } +// writerScanner scans the input from the reader and writes it to the logger func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...interface{})) { scanner := bufio.NewScanner(reader) + + // Set the buffer size to the maximum token size to avoid buffer overflows + scanner.Buffer(make([]byte, bufio.MaxScanTokenSize), bufio.MaxScanTokenSize) + + // Define a split function to split the input into chunks of up to 64KB + chunkSize := bufio.MaxScanTokenSize // 64KB + splitFunc := func(data []byte, atEOF bool) (int, []byte, error) { + if len(data) >= chunkSize { + return chunkSize, data[:chunkSize], nil + } + + return bufio.ScanLines(data, atEOF) + } + + // Use the custom split function to split the input + scanner.Split(splitFunc) + + // Scan the input and write it to the logger using the specified print function for scanner.Scan() { - printFunc(scanner.Text()) + printFunc(strings.TrimRight(scanner.Text(), "\r\n")) } + + // If there was an error while scanning the input, log an error if err := scanner.Err(); err != nil { entry.Errorf("Error while reading from Writer: %s", err) } + + // Close the reader when we are done reader.Close() } +// WriterFinalizer is a finalizer function that closes then given writer when it is garbage collected func writerFinalizer(writer *io.PipeWriter) { writer.Close() } diff --git a/vendor/modules.txt b/vendor/modules.txt index 010b40cd83..7f4981be05 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -153,7 +153,7 @@ github.com/cilium/proxy/go/envoy/type/matcher/v3 github.com/cilium/proxy/go/envoy/type/metadata/v3 github.com/cilium/proxy/go/envoy/type/tracing/v3 github.com/cilium/proxy/go/envoy/type/v3 -# github.com/cilium/tetragon/pkg/k8s v0.0.0-20230619094252-e60ba99096db +# github.com/cilium/tetragon/pkg/k8s v0.0.0-20230620174403-dbf8f0cfaa52 ## explicit; go 1.18 github.com/cilium/tetragon/pkg/k8s/apis/cilium.io github.com/cilium/tetragon/pkg/k8s/apis/cilium.io/v1alpha1 @@ -677,7 +677,7 @@ github.com/shirou/gopsutil/v3/mem # github.com/shopspring/decimal v1.3.1 ## explicit; go 1.13 github.com/shopspring/decimal -# github.com/sirupsen/logrus v1.9.2 +# github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus github.com/sirupsen/logrus/hooks/syslog