Skip to content

Commit

Permalink
add more tests for backend_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tjololo committed Nov 5, 2024
1 parent 59b2d18 commit 93d380b
Show file tree
Hide file tree
Showing 3 changed files with 456 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ func (r *BackendReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
logger.Info("Backend updated")
return ctrl.Result{RequeueAfter: 1 * time.Minute}, nil
}
logger.Info("Backend matches actual state")
if backend.Status.ProvisioningState != apimv1alpha1.BackendProvisioningStateSucceeded || backend.Status.BackendID != *azBackend.ID {
backend.Status.ProvisioningState = apimv1alpha1.BackendProvisioningStateSucceeded
backend.Status.BackendID = *azBackend.ID
if err := r.Status().Update(ctx, &backend); err != nil {
logger.Error(err, "Failed to update status")
return ctrl.Result{}, err
}
}
return ctrl.Result{RequeueAfter: 1 * time.Minute}, nil
}

Expand Down
Loading

0 comments on commit 93d380b

Please sign in to comment.