Skip to content

Commit

Permalink
fix: Do not run filesystem checks if fs is already mounted
Browse files Browse the repository at this point in the history
In order to meet idempotency requirements, don't run (and fail)
FS checks on an already mounted filesystem in NodePublishVolume
  • Loading branch information
David-T-White committed Feb 13, 2023
1 parent d769c22 commit 70a5b71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/storageService.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ func RemoveGatekeeper(volumeName string) {

// CheckFs: Perform a file system validation
func CheckFs(path string, fstype string, context string) error {

if IsVolumeInUse(path) {
klog.Infof("Volume already mounted, not performing FS check")
return nil
}

fsRepairCommand := "e2fsck"
if fstype == "xfs" {
fsRepairCommand = "xfs_repair"
Expand Down

0 comments on commit 70a5b71

Please sign in to comment.