Skip to content

Commit

Permalink
Add log to check requeuing request
Browse files Browse the repository at this point in the history
  • Loading branch information
R-HNF committed Jun 26, 2024
1 parent 97c5bf1 commit 9953d19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/pvc_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ func (r *pvcReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
pvc := &corev1.PersistentVolumeClaim{}
if err := r.Get(ctx, req.NamespacedName, pvc); err != nil {
if apierrors.IsNotFound(err) {
logger.Info(fmt.Sprintf("Requeue request because pvc='%s' is not found.", req.NamespacedName))
return requeueResult(10 * time.Second), nil
}
return ctrl.Result{}, xerrors.Errorf("Unexpected error occurred.: %w", err)
}
b := &fluentpvcv1alpha1.FluentPVCBinding{}
if err := r.Get(ctx, client.ObjectKey{Namespace: req.Namespace, Name: pvc.Name}, b); err != nil {
if apierrors.IsNotFound(err) {
logger.Info(fmt.Sprintf("Requeue request because fluentpvcbinding='%s' (namespace='%s') is not found.", pvc.Name, req.Namespace))
return requeueResult(10 * time.Second), nil
}
return ctrl.Result{}, xerrors.Errorf("Unexpected error occurred.: %w", err)
Expand Down

0 comments on commit 9953d19

Please sign in to comment.