Windows: Container log rotation may fail if the container logs are followed #124443
Labels
kind/bug
Categorizes issue or PR as related to a bug.
kind/failing-test
Categorizes issue or PR as related to a consistently or frequently failing test.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
sig/windows
Categorizes an issue or PR as relevant to SIG Windows.
What happened?
The test
k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs.TestReadRotatedLog
is failing on Windows [0]:The idea of the test is to check that kubelet still follows and reads the Container Logs after a Log Rotation occured. However, because the followed file is open, it cannot be renamed, and thus, the container logs cannot be rotated.
This issue could be prevented if the file would be opened with the
FILE_SHARE_DELETE
flag set [1]:Delete access allows both delete and rename operations.
[0] https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/ci-kubernetes-unit-windows-master/1782243642258231296
[1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea
What did you expect to happen?
Kubelet should not block container log rotation.
How can we reproduce it (as minimally and precisely as possible)?
Run the test
k8s.io/kubernetes/pkg/kubelet/kuberuntime/logs.TestReadRotatedLog
is failing on Windows.Anything else we need to know?
/sig windows
/kind bug
/kind failing-test
Kubernetes version
latest, master. This unit test has been failing for a while.
Cloud provider
N/A
OS version
Windows nodes
Install tools
N/A
Container runtime (CRI) and version (if applicable)
N/A
Related plugins (CNI, CSI, ...) and versions (if applicable)
N/A
The text was updated successfully, but these errors were encountered: