mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue Fix subPath existence check to not follow symlink **What this PR does / why we need it**: Volume mounting logic introduced in #43775 and #45623 checks for subPath existence before attempting to create a directory, should subPath not be present. This breaks if subPath is a dangling symlink, os.Stat returns "do not exist" status, yet `os.MkdirAll` can't create directory as symlink is present at the given path. This patch makes existence check to use os.Lstat which works for normal files/directories as well as doesn't not attempt to follow symlink, therefore it's "do not exist" status is more reliable when making a decision whether to create directory or not. subPath symlinks can be dangling in situations where kubelet is running in a container itself with access to docker socket, such as CoreOS's kubelet-wrapper script **Release note**: ```release-note Fix pods failing to start when subPath is a dangling symlink from kubelet point of view, which can happen if it is running inside a container ``` |
||
---|---|---|
.. | ||
async | ||
bandwidth | ||
config | ||
configz | ||
dbus | ||
ebtables | ||
env | ||
exec | ||
flock | ||
goroutinemap | ||
hash | ||
i18n | ||
initsystem | ||
interrupt | ||
io | ||
ipconfig | ||
iptables | ||
keymutex | ||
labels | ||
limitwriter | ||
logs | ||
maps | ||
metrics | ||
mount | ||
net | ||
netsh | ||
node | ||
oom | ||
parsers | ||
procfs | ||
removeall | ||
resourcecontainer | ||
rlimit | ||
selinux | ||
slice | ||
strings | ||
sysctl | ||
system | ||
tail | ||
taints | ||
term | ||
threading | ||
tolerations | ||
version | ||
workqueue/prometheus | ||
BUILD | ||
doc.go | ||
template.go | ||
template_test.go | ||
util.go | ||
util_test.go |