Skip to content

Commit

Permalink
Merge pull request #2909 from rewantsoni/mirror-fix
Browse files Browse the repository at this point in the history
controllers: fix mirroring controller
  • Loading branch information
openshift-merge-bot[bot] authored Nov 26, 2024
2 parents 5d188d4 + 1d7528a commit d8623c9
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 d8623c9

Please sign in to comment.