cephfs: set PV/PVC details on the subvolume as metadata on create

This helps Monitoring solutions without access to Kubernetes clusters to
display the details of the PV/PVC/NameSpace in their dashboard.

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
This commit is contained in:
Prasanna Kumar Kalever 2022-05-24 19:35:23 +05:30 committed by mergify[bot]
parent ecf03eb6ae
commit 6bcb8ecc68

View File

@ -386,6 +386,13 @@ func (cs *ControllerServer) CreateVolume(
return nil, status.Error(codes.Internal, err.Error()) return nil, status.Error(codes.Internal, err.Error())
} }
// Set Metadata on PV Create
metadata := k8s.GetVolumeMetadata(req.GetParameters())
err = volClient.SetAllMetadata(metadata)
if err != nil {
return nil, status.Error(codes.Internal, err.Error())
}
} }
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",