Skip to content

Commit

Permalink
fix(remount): skip monitoring volume unless mounted (#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Payes <payes.anand@mayadata.io>
  • Loading branch information
payes authored and vishnuitta committed Dec 10, 2019
1 parent ca00d4a commit 51d2880
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/utils/v1alpha1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ func MonitorMounts() {
break
}
for _, vol := range csivolList.Items {
// This check is added to avoid monitoring volume if it has not
// been mounted yet. Although CSIVolume CR gets created at
// ControllerPublish step.
if (vol.Spec.Volume.StagingTargetPath == "") ||
(vol.Spec.Volume.TargetPath == "") {
continue
}
// Search the volume in the list of mounted volumes at the node
// retrieved above
stagingMountPoint, stagingPathExists := listContains(
Expand Down

0 comments on commit 51d2880

Please # to comment.