cephfs: remove kubernetes csi prefixed parameters

remove kubernetes csi prefixed parameters
from the volumeContext as we dont want
to store it in the PV VolumeAttributes.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2022-03-15 16:34:28 +05:30 committed by mergify[bot]
parent a7315a04c1
commit 77011fbc61

View File

@ -27,6 +27,7 @@ import (
fsutil "github.com/ceph/ceph-csi/internal/cephfs/util" fsutil "github.com/ceph/ceph-csi/internal/cephfs/util"
csicommon "github.com/ceph/ceph-csi/internal/csi-common" csicommon "github.com/ceph/ceph-csi/internal/csi-common"
"github.com/ceph/ceph-csi/internal/util" "github.com/ceph/ceph-csi/internal/util"
"github.com/ceph/ceph-csi/internal/util/k8s"
"github.com/ceph/ceph-csi/internal/util/log" "github.com/ceph/ceph-csi/internal/util/log"
"github.com/container-storage-interface/spec/lib/go/csi" "github.com/container-storage-interface/spec/lib/go/csi"
@ -267,7 +268,8 @@ func (cs *ControllerServer) CreateVolume(
} }
} }
volumeContext := req.GetParameters() // remove kubernetes csi prefixed parameters.
volumeContext := k8s.RemoveCSIPrefixedParameters(req.GetParameters())
volumeContext["subvolumeName"] = vID.FsSubvolName volumeContext["subvolumeName"] = vID.FsSubvolName
volumeContext["subvolumePath"] = volOptions.RootPath volumeContext["subvolumePath"] = volOptions.RootPath
volume := &csi.Volume{ volume := &csi.Volume{
@ -340,7 +342,8 @@ func (cs *ControllerServer) CreateVolume(
log.DebugLog(ctx, "cephfs: successfully created backing volume named %s for request name %s", log.DebugLog(ctx, "cephfs: successfully created backing volume named %s for request name %s",
vID.FsSubvolName, requestName) vID.FsSubvolName, requestName)
volumeContext := req.GetParameters() // remove kubernetes csi prefixed parameters.
volumeContext := k8s.RemoveCSIPrefixedParameters(req.GetParameters())
volumeContext["subvolumeName"] = vID.FsSubvolName volumeContext["subvolumeName"] = vID.FsSubvolName
volumeContext["subvolumePath"] = volOptions.RootPath volumeContext["subvolumePath"] = volOptions.RootPath
volume := &csi.Volume{ volume := &csi.Volume{