mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: add check for imageFeatures parameter
This commit adds checks for missing `imageFeatures` parameter in createvolumerequest and nodestagerequest(only for static PVs). Missing `imageFeatures` parameter is ignored in case of non-static PVs to ensure backwards compatibility with older versions which did not have `imageFeatures` as required parameter. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -448,6 +448,13 @@ func (rv *rbdVolume) isInUse() (bool, error) {
|
||||
return len(watchers) > defaultWatchers, nil
|
||||
}
|
||||
|
||||
// checkImageFeatures check presence of imageFeatures parameter. It returns true when
|
||||
// there imageFeatures is missing or empty, skips missing parameter for non-static volumes
|
||||
// for backward compatibility.
|
||||
func checkImageFeatures(imageFeatures string, ok, static bool) bool {
|
||||
return static && (!ok || imageFeatures == "")
|
||||
}
|
||||
|
||||
// addRbdManagerTask adds a ceph manager task to execute command
|
||||
// asynchronously. If command is not found returns a bool set to false
|
||||
// example arg ["trash", "remove","pool/image"].
|
||||
|
Reference in New Issue
Block a user