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

fix: failed to sync work when binding's target clusters are empty #5818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vie-serendipity
Copy link
Contributor

What type of PR is this?

/kind bug
What this PR does / why we need it:
For now, when binding is not scheduled, which means clusters field is empty, work will still be synced. And this log will be printed.
Sync work of resourceBinding(%s/%s) successful
But actually no work is created. I think it's necessary to check whether clusters field of binding is empty. I'not sure this should be added to predicates of controller or just put it into syncbinding function, like my current pr code. I think the latter is better, in this way, users can see scheduling encounter some problems.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 14, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 14, 2024
test: correct unit tests
Signed-off-by: 宜松 <[email protected]>
Signed-off-by: vie-serendipity <[email protected]>
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chaunceyjiang for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 14, 2024
@XiShanYongYe-Chang
Copy link
Member

Hi @vie-serendipity thanks for your feedback. We can really decide whether to reconcile the ResourceBinding based on whether the scheduling has been completed (the ClusterResourceBinding has the same processing logic), which can save some unnecessary tuning. Therefore, I understand that this should be an optimization, not a bug fix.

In addition, we can judge whether the scheduling is completed in this way: obj.Status.SchedulerObservedGeneration == obj.Generation, this can cover the situation where there is no scheduling result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants