Skip to content

Commit

Permalink
handle error in case ownerRef is not set on crs binding
Browse files Browse the repository at this point in the history
  • Loading branch information
aartij17 committed Jan 24, 2022
1 parent 128b957 commit 8b8cbe3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ func (r *ClusterResourceSetBindingReconciler) Reconcile(ctx context.Context, req
if err != nil && !apierrors.IsNotFound(err) {
return ctrl.Result{}, err
}

if err == nil && cluster == nil {
log.Info("ownerRef not found for the ClusterResourceSetBinding")
// requeue the request
return ctrl.Result{}, nil
}
// If the owner cluster is already deleted or in deletion process, delete its ClusterResourceSetBinding
if apierrors.IsNotFound(err) || !cluster.DeletionTimestamp.IsZero() {
log.Info("deleting ClusterResourceSetBinding because the owner Cluster no longer exists")
Expand Down

0 comments on commit 8b8cbe3

Please sign in to comment.