mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
cephfs: No-Op Unprotect call if "snapshot-autoprotect" feature present
The subvolume features consists the list of features, which if includes
"snapshot-autoprotect", result in query based approach to
detecting the need for protect/unprotect.
If "snapshot-autoprotect" feature is present, The UnprotectSnapshot
call should be treated as a no-op
Signed-off-by: Yug <yuggupta27@gmail.com>
(cherry picked from commit 9e959c45a3
)
This commit is contained in:
parent
15463d8f52
commit
6a64958876
@ -27,7 +27,9 @@ import (
|
|||||||
|
|
||||||
// autoProtect points to the snapshot auto-protect feature of
|
// autoProtect points to the snapshot auto-protect feature of
|
||||||
// the subvolume.
|
// the subvolume.
|
||||||
const autoProtect = "snapshot-autoprotect"
|
const (
|
||||||
|
autoProtect = "snapshot-autoprotect"
|
||||||
|
)
|
||||||
|
|
||||||
// cephfsSnapshot represents a CSI snapshot and its cluster information.
|
// cephfsSnapshot represents a CSI snapshot and its cluster information.
|
||||||
type cephfsSnapshot struct {
|
type cephfsSnapshot struct {
|
||||||
@ -177,6 +179,11 @@ func protectSnapshot(ctx context.Context, volOptions *volumeOptions, cr *util.Cr
|
|||||||
}
|
}
|
||||||
|
|
||||||
func unprotectSnapshot(ctx context.Context, volOptions *volumeOptions, cr *util.Credentials, snapID, volID volumeID) error {
|
func unprotectSnapshot(ctx context.Context, volOptions *volumeOptions, cr *util.Credentials, snapID, volID volumeID) error {
|
||||||
|
// If "snapshot-autoprotect" feature is present, The UnprotectSnapshot
|
||||||
|
// call should be treated as a no-op.
|
||||||
|
if checkSubvolumeHasFeature(autoProtect, volOptions.Features) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
args := []string{
|
args := []string{
|
||||||
"fs",
|
"fs",
|
||||||
"subvolume",
|
"subvolume",
|
||||||
|
Loading…
Reference in New Issue
Block a user