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.130.0 to 2.130.1
- [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.130.0...v2.130.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2024-06-24 23:34:45 +00:00 committed by GitHub
parent c7f7fa5390
commit 2cf8237a13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 56 deletions

2
go.mod
View File

@ -79,7 +79,7 @@ require (
k8s.io/client-go v0.30.2 k8s.io/client-go v0.30.2
k8s.io/component-base v0.30.2 k8s.io/component-base v0.30.2
k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654 k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654
k8s.io/klog/v2 v2.130.0 k8s.io/klog/v2 v2.130.1
k8s.io/kubelet v0.30.2 k8s.io/kubelet v0.30.2
k8s.io/utils v0.0.0-20230726121419-3b25d923346b k8s.io/utils v0.0.0-20230726121419-3b25d923346b
tags.cncf.io/container-device-interface v0.7.2 tags.cncf.io/container-device-interface v0.7.2

4
go.sum
View File

@ -531,8 +531,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/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 h1:REcqRW1lajhGkr+RMfO5mQ7JYp93Fe65js/hJ8R/wq0=
k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654/go.mod h1:8SzLKTnltnWXG9FMIL4SHWcAnnPGssi5viN/SMMMf4k= k8s.io/cri-api v0.31.0-alpha.0.0.20240529224029-3a66d9d86654/go.mod h1:8SzLKTnltnWXG9FMIL4SHWcAnnPGssi5viN/SMMMf4k=
k8s.io/klog/v2 v2.130.0 h1:5nB3+3HpqKqXJIXNtJdtxcDCfaa9KL8StJgMzGJkUkM= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/klog/v2 v2.130.1/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 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
k8s.io/kubelet v0.30.2 h1:Ck4E/pHndI20IzDXxS57dElhDGASPO5pzXF7BcKfmCY= k8s.io/kubelet v0.30.2 h1:Ck4E/pHndI20IzDXxS57dElhDGASPO5pzXF7BcKfmCY=

77
vendor/k8s.io/klog/v2/klog.go generated vendored
View File

@ -404,13 +404,6 @@ func (t *traceLocation) Set(value string) error {
return nil return nil
} }
// flushSyncWriter is the interface satisfied by logging destinations.
type flushSyncWriter interface {
Flush() error
Sync() error
io.Writer
}
var logging loggingT var logging loggingT
var commandLine flag.FlagSet var commandLine flag.FlagSet
@ -486,7 +479,7 @@ type settings struct {
// Access to all of the following fields must be protected via a mutex. // Access to all of the following fields must be protected via a mutex.
// file holds writer for each of the log types. // file holds writer for each of the log types.
file [severity.NumSeverity]flushSyncWriter file [severity.NumSeverity]io.Writer
// flushInterval is the interval for periodic flushing. If zero, // flushInterval is the interval for periodic flushing. If zero,
// the global default will be used. // the global default will be used.
flushInterval time.Duration flushInterval time.Duration
@ -831,32 +824,12 @@ func (l *loggingT) printS(err error, s severity.Severity, depth int, msg string,
buffer.PutBuffer(b) buffer.PutBuffer(b)
} }
// redirectBuffer is used to set an alternate destination for the logs
type redirectBuffer struct {
w io.Writer
}
func (rb *redirectBuffer) Sync() error {
return nil
}
func (rb *redirectBuffer) Flush() error {
return nil
}
func (rb *redirectBuffer) Write(bytes []byte) (n int, err error) {
return rb.w.Write(bytes)
}
// SetOutput sets the output destination for all severities // SetOutput sets the output destination for all severities
func SetOutput(w io.Writer) { func SetOutput(w io.Writer) {
logging.mu.Lock() logging.mu.Lock()
defer logging.mu.Unlock() defer logging.mu.Unlock()
for s := severity.FatalLog; s >= severity.InfoLog; s-- { for s := severity.FatalLog; s >= severity.InfoLog; s-- {
rb := &redirectBuffer{ logging.file[s] = w
w: w,
}
logging.file[s] = rb
} }
} }
@ -868,10 +841,7 @@ func SetOutputBySeverity(name string, w io.Writer) {
if !ok { if !ok {
panic(fmt.Sprintf("SetOutputBySeverity(%q): unrecognized severity name", name)) panic(fmt.Sprintf("SetOutputBySeverity(%q): unrecognized severity name", name))
} }
rb := &redirectBuffer{ logging.file[sev] = w
w: w,
}
logging.file[sev] = rb
} }
// LogToStderr sets whether to log exclusively to stderr, bypassing outputs // LogToStderr sets whether to log exclusively to stderr, bypassing outputs
@ -1011,8 +981,8 @@ func (l *loggingT) exit(err error) {
logExitFunc(err) logExitFunc(err)
return return
} }
files := l.flushAll() needToSync := l.flushAll()
l.syncAll(files) l.syncAll(needToSync)
OsExit(2) OsExit(2)
} }
@ -1029,10 +999,6 @@ type syncBuffer struct {
maxbytes uint64 // The max number of bytes this syncBuffer.file can hold before cleaning up. maxbytes uint64 // The max number of bytes this syncBuffer.file can hold before cleaning up.
} }
func (sb *syncBuffer) Sync() error {
return sb.file.Sync()
}
// CalculateMaxSize returns the real max size in bytes after considering the default max size and the flag options. // CalculateMaxSize returns the real max size in bytes after considering the default max size and the flag options.
func CalculateMaxSize() uint64 { func CalculateMaxSize() uint64 {
if logging.logFile != "" { if logging.logFile != "" {
@ -1224,37 +1190,44 @@ func StartFlushDaemon(interval time.Duration) {
// lockAndFlushAll is like flushAll but locks l.mu first. // lockAndFlushAll is like flushAll but locks l.mu first.
func (l *loggingT) lockAndFlushAll() { func (l *loggingT) lockAndFlushAll() {
l.mu.Lock() l.mu.Lock()
files := l.flushAll() needToSync := l.flushAll()
l.mu.Unlock() l.mu.Unlock()
// Some environments are slow when syncing and holding the lock might cause contention. // Some environments are slow when syncing and holding the lock might cause contention.
l.syncAll(files) l.syncAll(needToSync)
} }
// flushAll flushes all the logs // flushAll flushes all the logs
// l.mu is held. // l.mu is held.
func (l *loggingT) flushAll() []flushSyncWriter { //
files := make([]flushSyncWriter, 0, severity.NumSeverity) // The result is the number of files which need to be synced and the pointers to them.
func (l *loggingT) flushAll() fileArray {
var needToSync fileArray
// Flush from fatal down, in case there's trouble flushing. // Flush from fatal down, in case there's trouble flushing.
for s := severity.FatalLog; s >= severity.InfoLog; s-- { for s := severity.FatalLog; s >= severity.InfoLog; s-- {
file := l.file[s] file := l.file[s]
if file != nil { if sb, ok := file.(*syncBuffer); ok && sb.file != nil {
_ = file.Flush() // ignore error _ = sb.Flush() // ignore error
needToSync.files[needToSync.num] = sb.file
needToSync.num++
} }
files = append(files, file)
} }
if logging.loggerOptions.flush != nil { if logging.loggerOptions.flush != nil {
logging.loggerOptions.flush() logging.loggerOptions.flush()
} }
return files return needToSync
}
type fileArray struct {
num int
files [severity.NumSeverity]*os.File
} }
// syncAll attempts to "sync" their data to disk. // syncAll attempts to "sync" their data to disk.
func (l *loggingT) syncAll(files []flushSyncWriter) { func (l *loggingT) syncAll(needToSync fileArray) {
// Flush from fatal down, in case there's trouble flushing. // Flush from fatal down, in case there's trouble flushing.
for _, file := range files { for i := 0; i < needToSync.num; i++ {
if file != nil { _ = needToSync.files[i].Sync() // ignore error
_ = file.Sync() // ignore error
}
} }
} }

2
vendor/modules.txt vendored
View File

@ -816,7 +816,7 @@ k8s.io/component-base/logs/logreduction
## explicit; go 1.22.0 ## explicit; go 1.22.0
k8s.io/cri-api/pkg/apis/runtime/v1 k8s.io/cri-api/pkg/apis/runtime/v1
k8s.io/cri-api/pkg/errors k8s.io/cri-api/pkg/errors
# k8s.io/klog/v2 v2.130.0 # k8s.io/klog/v2 v2.130.1
## explicit; go 1.18 ## explicit; go 1.18
k8s.io/klog/v2 k8s.io/klog/v2
k8s.io/klog/v2/internal/buffer k8s.io/klog/v2/internal/buffer