Skip to content

Commit c0db805

Browse files
fix(csi): tighten isNFSVolume to Filesystem-only
Address review feedback from gemini-code-assist on packages/apps/kubernetes/images/kubevirt-csi-driver/controller.go:562: classify a PVC as NFS only when its VolumeMode is Filesystem (or nil, which defaults to Filesystem), instead of "anything not Block". Future VolumeMode values will no longer be silently routed to the NFS path. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 712c93d commit c0db805

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎packages/apps/kubernetes/images/kubevirt-csi-driver/controller.go‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,7 @@ func isNFSVolume(pvc *corev1.PersistentVolumeClaim) bool {
555555
if !hasRWXAccessMode(pvc) {
556556
return false
557557
}
558-
if pvc.Spec.VolumeMode != nil && *pvc.Spec.VolumeMode == corev1.PersistentVolumeBlock {
559-
return false
560-
}
561-
return true
558+
return pvc.Spec.VolumeMode == nil || *pvc.Spec.VolumeMode == corev1.PersistentVolumeFilesystem
562559
}
563560

564561
// getNFSExport extracts the NFS export URL from a PersistentVolume.

0 commit comments

Comments
 (0)