@@ -53,6 +53,9 @@ const (
5353 volumeGroupReplicationContent = "VolumeGroupReplicationContent"
5454 volumeGroupReplicationRef = "replication.storage.openshift.io/volumegroupref"
5555 pvcSelector = "pvcSelector"
56+ // This annotation is added to a VGRC that has been dynamically provisioned by
57+ // csi-addons. Its value is name of driver that created the volume group.
58+ annDynamicallyProvisioned = "replication.storage.openshift.io/provisioned-by"
5659)
5760
5861// VolumeGroupReplicationReconciler reconciles a VolumeGroupReplication object
@@ -666,7 +669,7 @@ func (r *VolumeGroupReplicationReconciler) cleanupGroupPVC(vgr *replicationv1alp
666669}
667670
668671func (r * VolumeGroupReplicationReconciler ) createOrUpdateVolumeGroupReplicationContentCR (vgr * replicationv1alpha1.VolumeGroupReplication ,
669- vgrContentObj * replicationv1alpha1.VolumeGroupReplicationContent , vgrClass string , pvHandlesList []string ) error {
672+ vgrContentObj * replicationv1alpha1.VolumeGroupReplicationContent , driver string , pvHandlesList []string ) error {
670673 vgrRef := fmt .Sprintf ("%s/%s" , vgr .Namespace , vgr .Name )
671674 _ , err := controllerutil .CreateOrUpdate (r .ctx , r .Client , vgrContentObj , func () error {
672675 if vgr .Spec .VolumeGroupReplicationContentName != "" && vgrContentObj .CreationTimestamp .IsZero () {
@@ -682,7 +685,7 @@ func (r *VolumeGroupReplicationReconciler) createOrUpdateVolumeGroupReplicationC
682685 Namespace : vgr .Namespace ,
683686 UID : vgr .UID ,
684687 },
685- Provisioner : vgrClass ,
688+ Provisioner : driver ,
686689 VolumeGroupReplicationClassName : vgr .Spec .VolumeGroupReplicationClassName ,
687690 Source : replicationv1alpha1.VolumeGroupReplicationContentSource {
688691 VolumeHandles : pvHandlesList ,
@@ -695,6 +698,7 @@ func (r *VolumeGroupReplicationReconciler) createOrUpdateVolumeGroupReplicationC
695698 if vgrContentObj .Annotations [volumeGroupReplicationRef ] != vgrRef {
696699 metav1 .SetMetaDataAnnotation (& vgrContentObj .ObjectMeta , volumeGroupReplicationRef , vgrRef )
697700 }
701+ metav1 .SetMetaDataAnnotation (& vgrContentObj .ObjectMeta , annDynamicallyProvisioned , driver )
698702
699703 if vgrContentObj .Spec .VolumeGroupReplicationRef == nil {
700704 vgrContentObj .Spec .VolumeGroupReplicationRef = & corev1.ObjectReference {
0 commit comments