Merge pull request #585 from andyzhangx/remove-getArchivedInternalVolumePath

cleanup: remove unnecessary getArchivedInternalVolumePath func
This commit is contained in:
Andy Zhang 2024-01-15 15:13:16 +08:00 committed by GitHub
commit b501aab6a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,9 +243,7 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
internalVolumePath := getInternalVolumePath(cs.Driver.workingMountDir, nfsVol) internalVolumePath := getInternalVolumePath(cs.Driver.workingMountDir, nfsVol)
if strings.EqualFold(nfsVol.onDelete, archive) { if strings.EqualFold(nfsVol.onDelete, archive) {
archivedNfsVol := *nfsVol archivedInternalVolumePath := filepath.Join(getInternalMountPath(cs.Driver.workingMountDir, nfsVol), "archived-"+nfsVol.subDir)
archivedNfsVol.subDir = "archived-" + nfsVol.subDir
archivedInternalVolumePath := getArchivedInternalVolumePath(cs.Driver.workingMountDir, nfsVol, &archivedNfsVol)
// archive subdirectory under base-dir // archive subdirectory under base-dir
klog.V(2).Infof("archiving subdirectory %s --> %s", internalVolumePath, archivedInternalVolumePath) klog.V(2).Infof("archiving subdirectory %s --> %s", internalVolumePath, archivedInternalVolumePath)
@ -686,10 +684,6 @@ func getInternalVolumePath(workingMountDir string, vol *nfsVolume) string {
return filepath.Join(getInternalMountPath(workingMountDir, vol), vol.subDir) 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 // Given a nfsVolume, return a CSI volume id
func getVolumeIDFromNfsVol(vol *nfsVolume) string { func getVolumeIDFromNfsVol(vol *nfsVolume) string {
idElements := make([]string, totalIDElements) idElements := make([]string, totalIDElements)