Update comments and error messages

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko 2023-02-17 09:26:41 -08:00
parent d9e2487d0c
commit 19d9405a1c
5 changed files with 10 additions and 3 deletions

View File

@ -58146,7 +58146,7 @@ func schema_k8sio_kubelet_config_v1beta1_KubeletConfiguration(ref common.Referen
}, },
"podLogsDir": { "podLogsDir": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "podLogsDir is a custom root directory path kubelet will use to place pod's log files. Default: \"/var/log/pods\"", Description: "podLogsDir is a custom root directory path kubelet will use to place pod's log files. Default: \"/var/log/pods/\" Note: it is not recommended to use the temp folder as a log directory as it may cause unexpected behavior in many places.",
Type: []string{"string"}, Type: []string{"string"},
Format: "", Format: "",
}, },

View File

@ -89,6 +89,9 @@ type KubeletConfiguration struct {
// run, or the path to a single static pod file. // run, or the path to a single static pod file.
StaticPodPath string StaticPodPath string
// podLogsDir is a custom root directory path kubelet will use to place pod's log files. // podLogsDir is a custom root directory path kubelet will use to place pod's log files.
// Default: "/var/log/pods/"
// Note: it is not recommended to use the temp folder as a log directory as it may cause
// unexpected behavior in many places.
PodLogsDir string PodLogsDir string
// syncFrequency is the max period between synchronizing running // syncFrequency is the max period between synchronizing running
// containers and config // containers and config

View File

@ -256,6 +256,8 @@ func TestSetDefaultsKubeletConfiguration(t *testing.T) {
EnableDebugFlagsHandler: utilpointer.Bool(false), EnableDebugFlagsHandler: utilpointer.Bool(false),
SeccompDefault: utilpointer.Bool(false), SeccompDefault: utilpointer.Bool(false),
MemoryThrottlingFactor: utilpointer.Float64(0), MemoryThrottlingFactor: utilpointer.Float64(0),
RegisterNode: utilpointer.Bool(false),
LocalStorageCapacityIsolation: utilpointer.Bool(false),
PodLogsDir: "", PodLogsDir: "",
}, },
&v1beta1.KubeletConfiguration{ &v1beta1.KubeletConfiguration{

View File

@ -44,7 +44,7 @@ func TestGeneratePodSandboxConfig(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
pod := newTestPod() pod := newTestPod()
expectedLogDirectory := filepath.Join(testPodLogsRootDirectory, pod.Namespace+"_"+pod.Name+"_12345678") expectedLogDirectory := filepath.Join(testPodLogsDirectory, pod.Namespace+"_"+pod.Name+"_12345678")
expectedLabels := map[string]string{ expectedLabels := map[string]string{
"io.kubernetes.pod.name": pod.Name, "io.kubernetes.pod.name": pod.Name,
"io.kubernetes.pod.namespace": pod.Namespace, "io.kubernetes.pod.namespace": pod.Namespace,

View File

@ -99,7 +99,9 @@ type KubeletConfiguration struct {
// +optional // +optional
StaticPodPath string `json:"staticPodPath,omitempty"` StaticPodPath string `json:"staticPodPath,omitempty"`
// podLogsDir is a custom root directory path kubelet will use to place pod's log files. // podLogsDir is a custom root directory path kubelet will use to place pod's log files.
// Default: "/var/log/pods" // Default: "/var/log/pods/"
// Note: it is not recommended to use the temp folder as a log directory as it may cause
// unexpected behavior in many places.
// +optional // +optional
PodLogsDir string `json:"podLogsDir,omitempty"` PodLogsDir string `json:"podLogsDir,omitempty"`
// syncFrequency is the max period between synchronizing running // syncFrequency is the max period between synchronizing running