Fix PV path determination

This commit is contained in:
Tomasz Fruboes 2023-11-28 17:18:33 +01:00
parent 814e0d8d92
commit 9ef5d2375f
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ func (p *nfsProvisioner) Provision(ctx context.Context, options controller.Provi
func (p *nfsProvisioner) Delete(ctx context.Context, volume *v1.PersistentVolume) error {
path := volume.Spec.PersistentVolumeSource.NFS.Path
basePath := filepath.Base(path)
oldPath := strings.Replace(path, p.path, mountPath, 1)
oldPath := filepath.Join(mountPath, strings.Replace(path, p.path, "", 1))
if _, err := os.Stat(oldPath); os.IsNotExist(err) {
glog.Warningf("path %s does not exist, deletion skipped", oldPath)