Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why DependenciesDistributor only support ResourceBinding but not ClusterResourceBinding? #5096

Open
sysucjl opened this issue Jun 25, 2024 · 1 comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@sysucjl
Copy link

sysucjl commented Jun 25, 2024

What would you like to be added:
We want that relevant resources can be propagated automatically when we progate a kind of non-namespaced resourced. So We create a dependencyInterpretation for this non-namespaced resourced, and set propagateDeps=true in ClusterPropagationPolicy,but it not work.

This seems to be because that DependenciesDistributor can only handle ResourceBinding but not ClusterResourceBinding.

func (d *DependenciesDistributor) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
klog.V(4).Infof("Start to reconcile ResourceBinding(%s)", request.NamespacedName)
bindingObject := &workv1alpha2.ResourceBinding{}
err := d.Client.Get(ctx, request.NamespacedName, bindingObject)
if err != nil {
if apierrors.IsNotFound(err) {
klog.V(4).Infof("ResourceBinding(%s) has been removed.", request.NamespacedName)
return reconcile.Result{}, d.handleResourceBindingDeletion(request.Namespace, request.Name)
}
klog.Errorf("Failed to get ResourceBinding(%s): %v", request.NamespacedName, err)
return reconcile.Result{}, err
}
// in case users set PropagateDeps field from "true" to "false"
if !bindingObject.Spec.PropagateDeps || !bindingObject.DeletionTimestamp.IsZero() {
return reconcile.Result{}, d.handleResourceBindingDeletion(request.Namespace, request.Name)
}

Why is this needed:
DependenciesDistributor can also suport ClusterResourceBinding

@sysucjl sysucjl added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 25, 2024
@sysucjl sysucjl changed the title Why Propagate dependencies only support ResourceBinding but not ClusterResourceBinding? Why DependenciesDistributor only support ResourceBinding but not ClusterResourceBinding? Jun 25, 2024
@XiShanYongYe-Chang
Copy link
Member

Hi @sysucjl, thanks for your feedback, we do not currently support cluster scope resource dependencies distributor, because for workloads, they are namespace scoped.

By the way, do you use Karmada in the product?

We want that relevant resources can be propagated automatically when we progate a kind of non-namespaced resourced.

Can you elaborate on your usage scenario?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: No status
Development

No branches or pull requests

2 participants