Skip to content

Commit

Permalink
Pass remoteCentral by pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
rhybrillou committed May 25, 2023
1 parent 1030c85 commit 21e5bad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fleetshard/pkg/central/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (r *CentralReconciler) Reconcile(ctx context.Context, remoteCentral private
r.hasAuthProvider = true
}

status, err := r.collectReconciliationStatus(ctx, remoteCentral)
status, err := r.collectReconciliationStatus(ctx, &remoteCentral)
if err != nil {
return nil, err
}
Expand All @@ -374,14 +374,14 @@ func (r *CentralReconciler) Reconcile(ctx context.Context, remoteCentral private
return status, nil
}

func (r *CentralReconciler) collectReconciliationStatus(ctx context.Context, remoteCentral private.ManagedCentral) (*private.DataPlaneCentralStatus, error) {
func (r *CentralReconciler) collectReconciliationStatus(ctx context.Context, remoteCentral *private.ManagedCentral) (*private.DataPlaneCentralStatus, error) {
remoteCentralNamespace := remoteCentral.Metadata.Namespace

status := readyStatus()
// Do not report routes statuses if:
// 1. Routes are not used on the cluster
// 2. Central request is in status "Ready" - assuming that routes are already reported and saved
if r.useRoutes && !isRemoteCentralReady(remoteCentral) {
if r.useRoutes && !isRemoteCentralReady(*remoteCentral) {
var err error
status.Routes, err = r.getRoutesStatuses(ctx, remoteCentralNamespace)
if err != nil {
Expand Down

0 comments on commit 21e5bad

Please sign in to comment.