What happened:
The subDir parameter provides great flexibility allowing the user to set the subDir to something one considers helpful.
The problem is that when subDir is set to some nested directory tree like for example:
subDir=${pvc.metadata.namespace}/${pvc.metadata.name}/ when all the volumes from namespace are deleted, you will still see in the storage the empty $namespace directory.
The problem is even bigger if the depth of the subdir is bigger, for example:
subDir=${pvc.metadata.namespace}/${pvc.metadata.name}/${pv.metadata.name}
If I delete all the volumes of that namespace I will have at least 2 empty directories inside the $namespace directory on the nfs share.
What you expected to happen:
When deleting a volume, the driver should check if its parent is empty ( and it is inside a level of subDir ) and if so delete it too.
How to reproduce it:
Use subDir=${pvc.metadata.namespace}/${pvc.metadata.name}/${pv.metadata.name}
Use this values.yaml
What happened: The subDir parameter provides great flexibility allowing the user to set the subDir to something one considers helpful. The problem is that when subDir is set to some nested directory tree like for example:
subDir=${pvc.metadata.namespace}/${pvc.metadata.name}/
when all the volumes from namespace are deleted, you will still see in the storage the empty $namespace directory.The problem is even bigger if the depth of the subdir is bigger, for example:
subDir=${pvc.metadata.namespace}/${pvc.metadata.name}/${pv.metadata.name}
If I delete all the volumes of that namespace I will have at least 2 empty directories inside the $namespace directory on the nfs share.What you expected to happen: When deleting a volume, the driver should check if its parent is empty ( and it is inside a level of subDir ) and if so delete it too.
How to reproduce it: Use subDir=
${pvc.metadata.namespace}/${pvc.metadata.name}/${pv.metadata.name}
Use this values.yamland install wordpress to test it.
helm install wp oci://registry-1.docker.io/bitnamicharts/wordpress --namespace wp --create-namespace -f values.yml
Delete the wp namespace and check the remove NFS server, there will be several emptydirs under the wp folder.
Anything else we need to know?:
Environment:
kubectl version
): v1.30.3uname -a
):6.1.85-flatcar