mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rbd: remove topologyConstrainedPools parameter
This commit removes the `topologyConstrainedPools` parameter from PV volumeAttributes as it is not required. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -27,6 +27,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util/k8s"
|
||||
"github.com/ceph/ceph-csi/internal/util/log"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
@ -381,3 +382,34 @@ func CallStack() string {
|
||||
|
||||
return string(stack)
|
||||
}
|
||||
|
||||
// CheckSliceContains checks the slice for string.
|
||||
func CheckSliceContains(options []string, opt string) bool {
|
||||
for _, o := range options {
|
||||
if o == opt {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// GetVolumeContext filters out parameters that are not required in volume context.
|
||||
func GetVolumeContext(parameters map[string]string) map[string]string {
|
||||
volumeContext := map[string]string{}
|
||||
|
||||
// parameters that are not required in the volume context
|
||||
notRequiredParams := []string{
|
||||
topologyPoolsParam,
|
||||
}
|
||||
for k, v := range parameters {
|
||||
if !CheckSliceContains(notRequiredParams, k) {
|
||||
volumeContext[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
// remove kubernetes csi prefixed parameters.
|
||||
volumeContext = k8s.RemoveCSIPrefixedParameters(volumeContext)
|
||||
|
||||
return volumeContext
|
||||
}
|
||||
|
Reference in New Issue
Block a user