Skip to content

Commit

Permalink
Add -o ro mount flag to support readonly fs
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Jul 19, 2024
1 parent b4b7cf8 commit d143ab5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/mounter/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,5 +469,12 @@ func GetMountOptions(volumes *csi.VolumeCapability_MountVolume, accessModes *csi
}
}
}

if accessModes != nil {
if accessModes.GetMode() == csi.VolumeCapability_AccessMode_SINGLE_NODE_READER_ONLY || accessModes.GetMode() == csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY {
mountOptions = append(mountOptions, "ro")
}
}

return mountOptions
}

0 comments on commit d143ab5

Please sign in to comment.