@@ -127,6 +127,9 @@ func (r *VolumeGroupReplicationReconciler) Reconcile(ctx context.Context, req ct
127
127
return reconcile.Result {}, err
128
128
}
129
129
130
+ secretName := vgrClassObj .Spec .Parameters [prefixedGroupReplicationSecretNameKey ]
131
+ secretNamespace := vgrClassObj .Spec .Parameters [prefixedGroupReplicationSecretNamespaceKey ]
132
+
130
133
// Declare all dependent resources
131
134
vgrContentName := fmt .Sprintf ("vgrcontent-%s" , instance .UID )
132
135
if instance .Spec .VolumeGroupReplicationContentName != "" {
@@ -137,6 +140,11 @@ func (r *VolumeGroupReplicationReconciler) Reconcile(ctx context.Context, req ct
137
140
Name : vgrContentName ,
138
141
},
139
142
}
143
+ if secretName != "" && secretNamespace != "" {
144
+ metav1 .SetMetaDataAnnotation (& vgrContentObj .ObjectMeta , prefixedGroupReplicationSecretNameKey , secretName )
145
+ metav1 .SetMetaDataAnnotation (& vgrContentObj .ObjectMeta , prefixedGroupReplicationSecretNamespaceKey , secretNamespace )
146
+ }
147
+
140
148
vrName := fmt .Sprintf ("vr-%s" , instance .UID )
141
149
if instance .Spec .VolumeReplicationName != "" {
142
150
vrName = instance .Spec .VolumeReplicationName
@@ -656,9 +664,7 @@ func (r *VolumeGroupReplicationReconciler) createOrUpdateVolumeGroupReplicationC
656
664
return errors .New ("dependent VGRContent resource is not yet created, waiting for it to be created" )
657
665
}
658
666
if vgrContentObj .CreationTimestamp .IsZero () {
659
- vgrContentObj .Annotations = map [string ]string {
660
- volumeGroupReplicationRef : vgrRef ,
661
- }
667
+ metav1 .SetMetaDataAnnotation (& vgrContentObj .ObjectMeta , volumeGroupReplicationRef , vgrRef )
662
668
vgrContentObj .Spec = replicationv1alpha1.VolumeGroupReplicationContentSpec {
663
669
VolumeGroupReplicationRef : & corev1.ObjectReference {
664
670
APIVersion : vgr .APIVersion ,
@@ -678,7 +684,7 @@ func (r *VolumeGroupReplicationReconciler) createOrUpdateVolumeGroupReplicationC
678
684
}
679
685
680
686
if vgrContentObj .Annotations [volumeGroupReplicationRef ] != vgrRef {
681
- vgrContentObj .Annotations [ volumeGroupReplicationRef ] = vgrRef
687
+ metav1 . SetMetaDataAnnotation ( & vgrContentObj .ObjectMeta , volumeGroupReplicationRef , vgrRef )
682
688
}
683
689
684
690
if vgrContentObj .Spec .VolumeGroupReplicationRef == nil {
0 commit comments