mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 22:30: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>
This commit is contained in:
parent
6351358752
commit
59fc4aa00f
@ -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