Skip to content

Conversation

@zhzhuang-zju
Copy link
Contributor

@zhzhuang-zju zhzhuang-zju commented Nov 25, 2025

Cherry pick of #6723, #6755, #6934 on release-1.15.
#6723: fix the issue that rbSpec.Components is not updated when the
For details on the cherry pick process, see the cherry pick requests page.
#6755: fix the issue that resourcebinding validating webhook may panic when ReplicaRequirements of a Component in rbSpec.Components is nil.
#6934: enable federated resource quota calculation for multi-component scheduling.

`karmada-controller-manager`: Fixed the issue that `rbSpec.Components` is not updated when the template is updated.
`karmada-webhook`: Fixed the issue that resourcebinding validating webhook may panic when ReplicaRequirements of a Component in rbSpec.Components is nil.
`karmada-webhook`: Fixed the issue where the `FederatedResourceQuota` was not promptly updated when a multi-component workload generated new scheduling results.

@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 25, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @zhzhuang-zju, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request is an automated cherry-pick aimed at correcting a specific data handling oversight within the resource detection and policy application logic. It ensures that a critical field, Components, is consistently updated when resource binding policies are applied, thereby preventing unexpected behavior or data discrepancies in the system.

Highlights

  • Bug Fix: Resolved an issue where the rbSpec.Components field was not being updated correctly when applying policies, leading to potential data inconsistencies.
  • Policy Application Logic: Ensured that the Components field is properly copied during the ApplyPolicy and ApplyClusterPolicy operations within the resource detector.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes an issue where rbSpec.Components was not being updated when applying a policy. The change adds the missing line to copy the Components field in three places.

During the review, I noticed that the code for updating the binding specification is duplicated across ApplyPolicy and ApplyClusterPolicy. This has led to an inconsistency where the update logic for ClusterResourceBinding is missing the PropagateDeps and SchedulePriority fields. I've provided a comment with a code suggestion to fix this bug and another comment recommending refactoring the duplicated logic into a helper function to improve maintainability and prevent similar issues in the future.

@zhzhuang-zju zhzhuang-zju changed the title Automated cherry pick of #6723: fix the issue that rbSpec.Components is not updated when the WIP: Automated cherry pick of #6723: fix the issue that rbSpec.Components is not updated when the Nov 25, 2025
@karmada-bot karmada-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 25, 2025
@karmada-bot karmada-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 25, 2025
@zhzhuang-zju zhzhuang-zju changed the title WIP: Automated cherry pick of #6723: fix the issue that rbSpec.Components is not updated when the WIP: Automated cherry pick of #6723, #6755, #6934 Nov 25, 2025
@zhzhuang-zju zhzhuang-zju changed the title WIP: Automated cherry pick of #6723, #6755, #6934 Automated cherry pick of #6723, #6755, #6934 Nov 25, 2025
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 25, 2025
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.08%. Comparing base (5ace602) to head (d218ec2).

Files with missing lines Patch % Lines
pkg/webhook/resourcebinding/validating.go 79.16% 2 Missing and 3 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.15    #6954      +/-   ##
================================================
+ Coverage         46.07%   46.08%   +0.01%     
================================================
  Files               688      688              
  Lines             46580    46603      +23     
================================================
+ Hits              21461    21479      +18     
- Misses            23508    23513       +5     
  Partials           1611     1611              
Flag Coverage Δ
unittests 46.08% <81.48%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhzhuang-zju
Copy link
Contributor Author

/retest

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2025
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2025
@karmada-bot karmada-bot merged commit 3e55536 into karmada-io:release-1.15 Nov 25, 2025
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants