-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaningup empty parents resulted in all data being deleted #855
Comments
Hello, What happened: What you expected to happen: How to reproduce it: Environment: |
Same of this.
|
Similar Issues: #763 |
this is for solving this issue: #763, quite opposite requirement to cleanup empty parents when deleting PV |
working on a PR to only delete root folder of subDir when |
I am trying to understand what happened. According to @adelmoradian: but according to @UnknownAtoms and @san3Xian , delete one pvc inside a multi pvc namespace would delete all PVCs. ( directory ${pvc.metadata.namespace}/) @andyzhangx Was this a bug in the implementation? The parent should only be deleted if all children directories are empty. |
@andyzhangx concerning #876 , wouldn ´t be safer to traverse the parent's tree checking for files before using removeAll() or use Remove() that only delete empty dirs afaik ? |
What happened: if subDir is set to something like
foo/${pvc.metadata.namespace}/${pvc.metadata.name}/
and if there are no more PVCs left in a given namespace, all data under/foo
will be deleted.What you expected to happen: This is arguably caused by bad config since something like
subDir=${pvc.metadata.namespace}/${pvc.metadata.name}/
would prevent the issue. But still, would be nice to have this highlighted in the docs at least.I think the issue is caused here specifically by getRootDir.
How to reproduce it:
subDir=foo/${pvc.metadata.namespace}/${pvc.metadata.name}
Anything else we need to know?:
Environment:
kubectl version
): v1.31.2+rke2r1uname -a
): 6.8.0-31-genericThe text was updated successfully, but these errors were encountered: