From f9c8a9d794f3a630d715a8d609b7ba6f79f56ed2 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 18 Jan 2022 12:03:34 +0100 Subject: [PATCH] component-base: fix documentation of log flush frequency The intention for Kubernetes 1.23 was to support `flushFrequency: 60` and treat that as seconds. But time.Duration counts nanoseconds. Because the struct is embedded inside the beta KubeletConfiguration, we cannot switch to a type that serializes differently (like metav1.Duration) and therefore (for now) just update the documentation to match the implementation from Kubernetes 1.23. --- staging/src/k8s.io/component-base/config/types.go | 5 +++-- staging/src/k8s.io/component-base/config/v1alpha1/types.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/staging/src/k8s.io/component-base/config/types.go b/staging/src/k8s.io/component-base/config/types.go index 673085628d2..4a4c13a5da6 100644 --- a/staging/src/k8s.io/component-base/config/types.go +++ b/staging/src/k8s.io/component-base/config/types.go @@ -93,8 +93,9 @@ type LoggingConfiguration struct { // Format Flag specifies the structure of log messages. // default value of format is `text` Format string - // Maximum number of seconds between log flushes. Ignored if the - // selected logging backend writes log messages without buffering. + // Maximum number of nanoseconds (i.e. 1s = 1000000000) between log + // flushes. Ignored if the selected logging backend writes log + // messages without buffering. FlushFrequency time.Duration // Verbosity is the threshold that determines which log messages are // logged. Default is zero which logs only the most important diff --git a/staging/src/k8s.io/component-base/config/v1alpha1/types.go b/staging/src/k8s.io/component-base/config/v1alpha1/types.go index bd0183bca37..71a2e9e8875 100644 --- a/staging/src/k8s.io/component-base/config/v1alpha1/types.go +++ b/staging/src/k8s.io/component-base/config/v1alpha1/types.go @@ -90,8 +90,9 @@ type LoggingConfiguration struct { // Format Flag specifies the structure of log messages. // default value of format is `text` Format string `json:"format,omitempty"` - // Maximum number of seconds between log flushes. Ignored if the - // selected logging backend writes log messages without buffering. + // Maximum number of nanoseconds (i.e. 1s = 1000000000) between log + // flushes. Ignored if the selected logging backend writes log + // messages without buffering. FlushFrequency time.Duration `json:"flushFrequency"` // Verbosity is the threshold that determines which log messages are // logged. Default is zero which logs only the most important