k8s.io/component-base/logs: support changing verbosity of JSON output

The GlogSetter method is used by three components to change verbosity at
runtime through HTTP APIs. This used to work only for text output with klog
calls, but not for text output through the klog logger or for JSON output.

Now loggers can also provide a callback for changing their verbosity at
runtime. Implementing that implies that the Create factory method has to be
extended, which is an API break for the Go package, but not an API break for
the configuration file and command line flags, which is what matters for the
"api/v1" component API.
This commit is contained in:
Patrick Ohly
2022-12-20 16:05:46 +01:00
parent 8881b71822
commit 9b86f457e9
14 changed files with 249 additions and 23 deletions

1
vendor/modules.txt vendored
View File

@@ -2000,6 +2000,7 @@ k8s.io/component-base/featuregate
k8s.io/component-base/featuregate/testing
k8s.io/component-base/logs
k8s.io/component-base/logs/api/v1
k8s.io/component-base/logs/internal/setverbositylevel
k8s.io/component-base/logs/json
k8s.io/component-base/logs/json/register
k8s.io/component-base/logs/klogflags