You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried to start a container with SELinux labeling for volume, I got the following error and could not start a container.
$ docker run --log-driver=journald -d --name=kubelet --read-only --network=host \
--uts=host --pid=host --privileged \
--tmpfs=/tmp --volume=/var/lib/kubelet:/var/lib/kubelet:rshared,z \
quay.io/cybozu/kubernetes:1.25.6.1 kubelet
docker: Error response from daemon:
error setting label on mount source '/var/lib/kubelet':
lstat /var/lib/kubelet/seccomp/2/pwalk-test-1270530707/d-2753637893/f-1857926114: no such file or directory.
I think this error was returned from pkg/pwalk in opencontainers/selinux.
I found that the error lstat no such file or direcotry is returned if a file is deleted while filepath.Walk of the pwalk function is retrieving the list of files in a directory.
In my environment, it is possible that files under the target directory are frequently deleted during the process of SELinux labeling.
I think it is undesirable behavior to return an error, even if it is a specific environment.
How about adding error handling to make it work in such environment? https://github.com/opencontainers/selinux/blob/main/pkg/pwalk/pwalk.go#L88C2-L91
When I tried to start a container with SELinux labeling for volume, I got the following error and could not start a container.
I think this error was returned from pkg/pwalk in opencontainers/selinux.
I found that the error
lstat no such file or direcotry
is returned if a file is deleted whilefilepath.Walk
of the pwalk function is retrieving the list of files in a directory.In my environment, it is possible that files under the target directory are frequently deleted during the process of SELinux labeling.
I think it is undesirable behavior to return an error, even if it is a specific environment.
How about adding error handling to make it work in such environment?
https://github.com/opencontainers/selinux/blob/main/pkg/pwalk/pwalk.go#L88C2-L91
Environments.
To Reproduce.
prepareTest
functionpwalk.Walk
function.lstat <directory/file name> no such file or directory
The text was updated successfully, but these errors were encountered: