From 555dc4ea9ccdb085f1ad0fdd0448e33e33345d35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:14:36 +0000 Subject: [PATCH] build(deps): bump k8s.io/klog/v2 from 2.120.1 to 2.130.0 Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.120.1 to 2.130.0. - [Release notes](https://github.com/kubernetes/klog/releases) - [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md) - [Commits](https://github.com/kubernetes/klog/compare/v2.120.1...v2.130.0) --- updated-dependencies: - dependency-name: k8s.io/klog/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/k8s.io/klog/v2/klog.go | 25 ++++++++++++++++++++----- vendor/modules.txt | 2 +- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7269efd4..2e73b265 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/kubernetes-csi/csi-lib-utils v0.14.1 golang.org/x/net v0.26.0 google.golang.org/grpc v1.64.0 - k8s.io/klog/v2 v2.120.1 + k8s.io/klog/v2 v2.130.0 k8s.io/kubernetes v1.27.13 k8s.io/mount-utils v0.27.13 // indirect ) diff --git a/go.sum b/go.sum index 3d1d599d..97426fe9 100644 --- a/go.sum +++ b/go.sum @@ -298,8 +298,8 @@ k8s.io/component-base v0.27.13/go.mod h1:QKur/xRE4R25PhScEe3lAhrVSwEuZPGlFPyEDOa k8s.io/component-helpers v0.27.13 h1:o2pj2ycWJw8f+Gjh66GrvSk6Oz1jsd9GNr/IqaclSyw= k8s.io/component-helpers v0.27.13/go.mod h1:fbi9kk3Y2lypTKOSiIpTmYGLj1CsVO7BmSIa0dq28ao= k8s.io/csi-translation-lib v0.27.13 h1:Fu1f/gsWGEqlwW7kYaDH65v9RU7T3+fSqQNk9WzSFgQ= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/klog/v2 v2.130.0 h1:5nB3+3HpqKqXJIXNtJdtxcDCfaa9KL8StJgMzGJkUkM= +k8s.io/klog/v2 v2.130.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/kubernetes v1.27.13 h1:5NBz3aNy5Jwcgi+w2+rP4x5B0Wa21NXUJxDJwdUtxlY= diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go index 026be9e3..16dcb3b9 100644 --- a/vendor/k8s.io/klog/v2/klog.go +++ b/vendor/k8s.io/klog/v2/klog.go @@ -1011,7 +1011,8 @@ func (l *loggingT) exit(err error) { logExitFunc(err) return } - l.flushAll() + files := l.flushAll() + l.syncAll(files) OsExit(2) } @@ -1223,24 +1224,38 @@ func StartFlushDaemon(interval time.Duration) { // lockAndFlushAll is like flushAll but locks l.mu first. func (l *loggingT) lockAndFlushAll() { l.mu.Lock() - l.flushAll() + files := l.flushAll() l.mu.Unlock() + // Some environments are slow when syncing and holding the lock might cause contention. + l.syncAll(files) } -// flushAll flushes all the logs and attempts to "sync" their data to disk. +// flushAll flushes all the logs // l.mu is held. -func (l *loggingT) flushAll() { +func (l *loggingT) flushAll() []flushSyncWriter { + files := make([]flushSyncWriter, 0, severity.NumSeverity) // Flush from fatal down, in case there's trouble flushing. for s := severity.FatalLog; s >= severity.InfoLog; s-- { file := l.file[s] if file != nil { _ = file.Flush() // ignore error - _ = file.Sync() // ignore error } + files = append(files, file) } if logging.loggerOptions.flush != nil { logging.loggerOptions.flush() } + return files +} + +// syncAll attempts to "sync" their data to disk. +func (l *loggingT) syncAll(files []flushSyncWriter) { + // Flush from fatal down, in case there's trouble flushing. + for _, file := range files { + if file != nil { + _ = file.Sync() // ignore error + } + } } // CopyStandardLogTo arranges for messages written to the Go "log" package's diff --git a/vendor/modules.txt b/vendor/modules.txt index 93192ff7..a9b5de3d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -633,7 +633,7 @@ k8s.io/component-helpers/node/util/sysctl k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity k8s.io/component-helpers/storage/volume -# k8s.io/klog/v2 v2.120.1 +# k8s.io/klog/v2 v2.130.0 ## explicit; go 1.18 k8s.io/klog/v2 k8s.io/klog/v2/internal/buffer