mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cephfs: added support for snapshot-backed volumes
This commit implements most of docs/design/proposals/cephfs-snapshot-shallow-ro-vol.md design document; specifically (de-)provisioning of snapshot-backed volumes, mounting such volumes as well as mounting pre-provisioned snapshot-backed volumes. Signed-off-by: Robert Vasek <robert.vasek@cern.ch>
This commit is contained in:
committed by
mergify[bot]
parent
0807fd2e6c
commit
fd7559a903
@ -118,8 +118,8 @@ func (m *FuseMounter) Mount(
|
||||
|
||||
func (m *FuseMounter) Name() string { return "Ceph FUSE driver" }
|
||||
|
||||
func UnmountVolume(ctx context.Context, mountPoint string) error {
|
||||
if _, stderr, err := util.ExecCommand(ctx, "umount", mountPoint); err != nil {
|
||||
func UnmountVolume(ctx context.Context, mountPoint string, opts ...string) error {
|
||||
if _, stderr, err := util.ExecCommand(ctx, "umount", append([]string{mountPoint}, opts...)...); err != nil {
|
||||
err = fmt.Errorf("%w stderr: %s", err, stderr)
|
||||
if strings.Contains(err.Error(), fmt.Sprintf("umount: %s: not mounted", mountPoint)) ||
|
||||
strings.Contains(err.Error(), "No such file or directory") {
|
||||
@ -149,3 +149,7 @@ func UnmountVolume(ctx context.Context, mountPoint string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func UnmountAll(ctx context.Context, mountPoint string) error {
|
||||
return UnmountVolume(ctx, mountPoint, "--all-targets")
|
||||
}
|
||||
|
Reference in New Issue
Block a user