Skip to content

Commit

Permalink
Merge pull request #585 from andyzhangx/remove-getArchivedInternalVol…
Browse files Browse the repository at this point in the history
…umePath

cleanup: remove unnecessary getArchivedInternalVolumePath func
  • Loading branch information
andyzhangx authored Jan 15, 2024
2 parents 5756e45 + 383cb9b commit b501aab
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/nfs/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
internalVolumePath := getInternalVolumePath(cs.Driver.workingMountDir, nfsVol)

if strings.EqualFold(nfsVol.onDelete, archive) {
archivedNfsVol := *nfsVol
archivedNfsVol.subDir = "archived-" + nfsVol.subDir
archivedInternalVolumePath := getArchivedInternalVolumePath(cs.Driver.workingMountDir, nfsVol, &archivedNfsVol)
archivedInternalVolumePath := filepath.Join(getInternalMountPath(cs.Driver.workingMountDir, nfsVol), "archived-"+nfsVol.subDir)

// archive subdirectory under base-dir
klog.V(2).Infof("archiving subdirectory %s --> %s", internalVolumePath, archivedInternalVolumePath)
Expand Down Expand Up @@ -686,10 +684,6 @@ func getInternalVolumePath(workingMountDir string, vol *nfsVolume) string {
return filepath.Join(getInternalMountPath(workingMountDir, vol), vol.subDir)
}

func getArchivedInternalVolumePath(workingMountDir string, vol *nfsVolume, archVol *nfsVolume) string {
return filepath.Join(getInternalMountPath(workingMountDir, vol), archVol.subDir)
}

// Given a nfsVolume, return a CSI volume id
func getVolumeIDFromNfsVol(vol *nfsVolume) string {
idElements := make([]string, totalIDElements)
Expand Down

0 comments on commit b501aab

Please sign in to comment.