mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-27 08:40:23 +00:00
cephfs: validate if subvolume has snapshot-retention feature
Add validateSnapshotRetention() to verify if subvolume has
`snapshot-retention` feature.
Signed-off-by: Yug <yuggupta27@gmail.com>
(cherry picked from commit 59fc4aa00f
)
This commit is contained in:
parent
5daf21831e
commit
0f51df99e8
@ -269,3 +269,16 @@ func purgeVolume(ctx context.Context, volID volumeID, cr *util.Credentials, volO
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// checkSubvolumeHasFeature verifies if the referred subvolume has
|
||||
// the required feature.
|
||||
func checkSubvolumeHasFeature(feature string, subVolFeatures []string) bool {
|
||||
// The subvolume "features" are based on the internal version of the subvolume.
|
||||
// Verify if subvolume supports the required feature.
|
||||
for _, subvolFeature := range subVolFeatures {
|
||||
if subvolFeature == feature {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user