Merge pull request #1636 from ctripcloud/update-fetch-workload

skip reconciling loop quickly after workload gone
This commit is contained in:
karmada-bot 2022-04-22 14:44:10 +08:00 committed by GitHub
commit c36be6b6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,9 @@ func (c *ResourceBindingController) syncBinding(binding *workv1alpha2.ResourceBi
workload, err := helper.FetchWorkload(c.DynamicClient, c.InformerManager, c.RESTMapper, binding.Spec.Resource)
if err != nil {
if apierrors.IsNotFound(err) {
return controllerruntime.Result{}, nil
}
klog.Errorf("Failed to fetch workload for resourceBinding(%s/%s). Error: %v.",
binding.GetNamespace(), binding.GetName(), err)
return controllerruntime.Result{Requeue: true}, err

View File

@ -108,6 +108,9 @@ func (c *ClusterResourceBindingController) syncBinding(binding *workv1alpha2.Clu
workload, err := helper.FetchWorkload(c.DynamicClient, c.InformerManager, c.RESTMapper, binding.Spec.Resource)
if err != nil {
if apierrors.IsNotFound(err) {
return controllerruntime.Result{}, nil
}
klog.Errorf("Failed to fetch workload for clusterResourceBinding(%s). Error: %v.", binding.GetName(), err)
return controllerruntime.Result{Requeue: true}, err
}