Skip to content

Commit

Permalink
controllers: fix mirroring controller
Browse files Browse the repository at this point in the history
1. Update the mirroring finalizer to the right name
2. fix radosnamespace mirroring

Signed-off-by: Rewant Soni <resoni@redhat.com>
  • Loading branch information
rewantsoni committed Nov 26, 2024
1 parent 5d188d4 commit 1d7528a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/mirroring/mirroring_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import (
const (
// internalKey is a special key for storage-client-mapping to establish mirroring between blockPools for internal mode
internalKey = "internal"
mirroringFinalizer = "mirroring.ocs.openshift.io"
mirroringFinalizer = "ocs.openshift.io/mirroring"
clientIDIndexName = "clientID"
)

Expand Down Expand Up @@ -429,7 +429,7 @@ func (r *MirroringReconciler) reconcileRadosNamespaceMirroring(
ocsClient *providerClient.OCSProviderClient,
clientMappingConfig *corev1.ConfigMap,
storageClusterPeer *ocsv1.StorageClusterPeer,
disableMirroring bool,
shouldMirror bool,
) bool {
/*
Algorithm:
Expand Down Expand Up @@ -520,13 +520,13 @@ func (r *MirroringReconciler) reconcileRadosNamespaceMirroring(
remoteClientID := clientMappingConfig.Data[consumer.Status.Client.ID]
remoteNamespace := remoteNamespaceByClientID[remoteClientID]
_, err = controllerutil.CreateOrUpdate(r.ctx, r.Client, rns, func() error {
if remoteNamespace == "" || disableMirroring {
rns.Spec.Mirroring = nil
} else {
if remoteNamespace != "" && shouldMirror {
rns.Spec.Mirroring = &rookCephv1.RadosNamespaceMirroring{
RemoteNamespace: ptr.To(remoteNamespace),
Mode: "image",
}
} else {
rns.Spec.Mirroring = nil
}
return nil
})
Expand Down

0 comments on commit 1d7528a

Please sign in to comment.