mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-06-10 10:15:57 +00:00
vendor: revendor
This commit is contained in:
parent
269295a414
commit
9f0440be0f
669 changed files with 58447 additions and 20021 deletions
9
vendor/k8s.io/component-base/logs/options.go
generated
vendored
9
vendor/k8s.io/component-base/logs/options.go
generated
vendored
|
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/go-logr/logr"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/component-base/logs/sanitization"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
|
|
@ -40,7 +41,8 @@ var supportedLogsFlags = map[string]struct{}{
|
|||
|
||||
// Options has klog format parameters
|
||||
type Options struct {
|
||||
LogFormat string
|
||||
LogFormat string
|
||||
LogSanitization bool
|
||||
}
|
||||
|
||||
// NewOptions return new klog options
|
||||
|
|
@ -88,6 +90,8 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
|
|||
|
||||
// No new log formats should be added after generation is of flag options
|
||||
logRegistry.Freeze()
|
||||
fs.BoolVar(&o.LogSanitization, "experimental-logging-sanitization", o.LogSanitization, `[Experimental] When enabled prevents logging of fields tagged as sensitive (passwords, keys, tokens).
|
||||
Runtime log sanitization may introduce significant computation overhead and therefore should not be enabled in production.`)
|
||||
}
|
||||
|
||||
// Apply set klog logger from LogFormat type
|
||||
|
|
@ -95,6 +99,9 @@ func (o *Options) Apply() {
|
|||
// if log format not exists, use nil loggr
|
||||
loggr, _ := o.Get()
|
||||
klog.SetLogger(loggr)
|
||||
if o.LogSanitization {
|
||||
klog.SetLogFilter(&sanitization.SanitizingFilter{})
|
||||
}
|
||||
}
|
||||
|
||||
// Get logger with LogFormat field
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue