Closed mpatlasov closed 2 months ago
we are using os.RemoveAll
to remove the dir, how should this driver delete the dir without permission?
we are using
os.RemoveAll
to remove the dir, how should this driver delete the dir without permission?
chmod -R a+rwx <volume-dir>
would fix the issue. See https://github.com/kubernetes-csi/csi-driver-smb/pull/840 please.
What happened:
When deleting a Pod with PV with "Delete" reclaim policy, DeleteVolume() attempts to cleanup volume, but fails if it contains a directory without write permissions. PV got stuck in "Released" status and reports error:
Inside SMB server, corresponding volume is also not deleted:
What you expected to happen:
Both PV object and a share on SMB server must be deleted (the same way as it happens without read-only subdir).
How to reproduce it:
Create StorageClass:
for a samba server from https://github.com/samba-in-kubernetes/samba-container .
Create a Pod requesting samba PV:
Create read-only subdir inside the Pod, then delete Pod and PVC:
PV is not deleted:
It reports error:
And read-only dir still exists inside samba server:
Anything else we need to know?:
Environment:
CSI Driver version: Image manually built by
docker build ... -f ./cmd/smbplugin/Dockerfile .
from the top of upstream master branch (commit 4d10e97800759 of https://github.com/kubernetes-csi/csi-driver-smb.git)Kubernetes version (use
kubectl version
):