From f6f655ccfe2e3827eda26c8e6152ea455ea07a81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 00:01:25 +0000 Subject: [PATCH] build(deps): bump k8s.io/klog/v2 in the k8s group Bumps the k8s group with 1 update: [k8s.io/klog/v2](https://github.com/kubernetes/klog). Updates `k8s.io/klog/v2` 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 dependency-group: k8s ... 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 5acc3ef8d..1c77f0ff9 100644 --- a/go.mod +++ b/go.mod @@ -79,7 +79,7 @@ require ( k8s.io/client-go v0.30.2 k8s.io/component-base v0.30.2 k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654 - k8s.io/klog/v2 v2.120.1 + k8s.io/klog/v2 v2.130.0 k8s.io/kubelet v0.30.2 k8s.io/utils v0.0.0-20230726121419-3b25d923346b tags.cncf.io/container-device-interface v0.7.2 diff --git a/go.sum b/go.sum index 74e06572c..79eda3dea 100644 --- a/go.sum +++ b/go.sum @@ -530,8 +530,8 @@ k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII= k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE= k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654 h1:REcqRW1lajhGkr+RMfO5mQ7JYp93Fe65js/hJ8R/wq0= k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654/go.mod h1:8SzLKTnltnWXG9FMIL4SHWcAnnPGssi5viN/SMMMf4k= -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/kubelet v0.30.2 h1:Ck4E/pHndI20IzDXxS57dElhDGASPO5pzXF7BcKfmCY= diff --git a/vendor/k8s.io/klog/v2/klog.go b/vendor/k8s.io/klog/v2/klog.go index 026be9e3b..16dcb3b9d 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 329e68d1f..fec1984ca 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -816,7 +816,7 @@ k8s.io/component-base/logs/logreduction ## explicit; go 1.22.0 k8s.io/cri-api/pkg/apis/runtime/v1 k8s.io/cri-api/pkg/errors -# 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