From 689447c63216e6dc8cbb143127e423bbdfd1130c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 02:04:58 +0000 Subject: [PATCH] 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 b7c8ec97bd..f3c7cfe991 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( k8s.io/client-go v0.30.2 k8s.io/cri-api v0.31.0-alpha.0.0.20240528091733-69e407966029 k8s.io/cri-client v0.31.0-alpha.0.0.20240530211015-c9749ee02fc0 - k8s.io/klog/v2 v2.120.1 + k8s.io/klog/v2 v2.130.0 k8s.io/kubectl v0.30.2 k8s.io/kubelet v0.30.2 sigs.k8s.io/yaml v1.4.0 diff --git a/go.sum b/go.sum index 92503be558..1c38fd8aaf 100644 --- a/go.sum +++ b/go.sum @@ -242,8 +242,8 @@ k8s.io/cri-api v0.31.0-alpha.0.0.20240528091733-69e407966029 h1:P+TWC7iOMWA2mWiN k8s.io/cri-api v0.31.0-alpha.0.0.20240528091733-69e407966029/go.mod h1:bUzKm5FAhhVPHj344pvpKRIdGJMJ79mBHGrubR3TqZY= k8s.io/cri-client v0.31.0-alpha.0.0.20240530211015-c9749ee02fc0 h1:A/qaNv8usB/HEZeWRcFe117POP0Sheqc9xnuYrBxYu8= k8s.io/cri-client v0.31.0-alpha.0.0.20240530211015-c9749ee02fc0/go.mod h1:TarJVY/GTbu+Ht1IqT6eh5QXXxKwMfb2+7TpY/XlAhs= -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-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/kubectl v0.30.2 h1:cgKNIvsOiufgcs4yjvgkK0+aPCfa8pUwzXdJtkbhsH8= diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go index 026be9e3b1..16dcb3b9d4 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 77380e50f0..3e17a3eb67 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -546,7 +546,7 @@ k8s.io/cri-client/pkg k8s.io/cri-client/pkg/internal k8s.io/cri-client/pkg/logs k8s.io/cri-client/pkg/util -# 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