mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: set cluster Name as metadata on the image
This change helps read the cluster name from the cmdline args, the provisioner will set the same on the RBD images. Fixes: #2973 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
deb003e605
commit
2880c25fd6
@ -51,6 +51,9 @@ type ControllerServer struct {
|
||||
|
||||
// A map storing all volumes/snapshots with ongoing operations.
|
||||
OperationLocks *util.OperationLock
|
||||
|
||||
// Cluster name
|
||||
ClusterName string
|
||||
}
|
||||
|
||||
func (cs *ControllerServer) validateVolumeReq(ctx context.Context, req *csi.CreateVolumeRequest) error {
|
||||
@ -132,6 +135,8 @@ func (cs *ControllerServer) parseVolCreateRequest(
|
||||
return nil, status.Error(codes.InvalidArgument, err.Error())
|
||||
}
|
||||
|
||||
rbdVol.ClusterName = cs.ClusterName
|
||||
|
||||
// if the KMS is of type VaultToken, additional metadata is needed
|
||||
// depending on the tenant, the KMS can be configured with other
|
||||
// options
|
||||
@ -1090,6 +1095,7 @@ func (cs *ControllerServer) CreateSnapshot(
|
||||
|
||||
// Update the metadata on snapshot not on the original image
|
||||
rbdVol.RbdImageName = rbdSnap.RbdSnapName
|
||||
rbdVol.ClusterName = cs.ClusterName
|
||||
|
||||
err = rbdVol.unsetAllMetadata(k8s.GetVolumeMetadataKeys())
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user