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

Align federated Deployment's observedGeneration semantics with its native #4867

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

veophi
Copy link

@veophi veophi commented Apr 24, 2024

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:
Part of #4870, #5021

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-controller-manager`: Mark `.status.observedGeneration` of Deployment with `.metadata.generation` only when all members' statuses are algined with its resource template generation.

@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 Apr 24, 2024
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 35.29412% with 22 lines in your changes missing coverage. Please review.

Project coverage is 28.22%. Comparing base (95e3264) to head (933343d).
Report is 14 commits behind head on master.

Files Patch % Lines
...esourceinterpreter/default/native/reflectstatus.go 0.00% 17 Missing ⚠️
...ourceinterpreter/default/native/aggregatestatus.go 80.00% 1 Missing and 2 partials ⚠️
pkg/controllers/binding/common.go 0.00% 1 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4867   +/-   ##
=======================================
  Coverage   28.22%   28.22%           
=======================================
  Files         632      632           
  Lines       43431    43454   +23     
=======================================
+ Hits        12259    12266    +7     
- Misses      30278    30291   +13     
- Partials      894      897    +3     
Flag Coverage Δ
unittests 28.22% <35.29%> (+<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.

@XiShanYongYe-Chang
Copy link
Member

Hi @veophi can you help fix the lint error?

@XiShanYongYe-Chang
Copy link
Member

/assign @yike21

@veophi veophi force-pushed the bugfix/deployment-generation branch 2 times, most recently from f380479 to cf79f5b Compare April 25, 2024 02:32
@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 25, 2024
@veophi
Copy link
Author

veophi commented Apr 25, 2024

Hi @veophi can you help fix the lint error?

@XiShanYongYe-Chang fixed.

@XiShanYongYe-Chang
Copy link
Member

Hi @veophi, Is this pr ready? If it is ready, you can remove the WIP info in the title. Then the work-in-progress label will be removed, indicating that the current pr is ready.

In addition, you can add the issue number of the current pr to the end of Fiexs, like this:

**Which issue(s) this PR fixes:**
Fixes #4866

and GitHub will automatically associate it with the issue. After the pr is merged, the associated issue will be closed.

@veophi veophi changed the title [WIP]: fix Deployment generation/observedGeneration logic [buggix] fix Deployment generation/observedGeneration logic Apr 25, 2024
@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 Apr 25, 2024
@veophi veophi changed the title [buggix] fix Deployment generation/observedGeneration logic [bugfix] fix Deployment generation/observedGeneration logic Apr 25, 2024
@veophi veophi changed the title [bugfix] fix Deployment generation/observedGeneration logic fix: Deployment generation/observedGeneration bug Apr 25, 2024
@veophi veophi force-pushed the bugfix/deployment-generation branch from cf79f5b to fa2364f Compare April 25, 2024 03:28
Copy link
Member

@yike21 yike21 left a comment

Choose a reason for hiding this comment

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

/lgtm
There are now stricter requirements for aligning the status.observedGeneration of a federated resource (deployment) with its metadata.generation.
Sometimes you may find that the status.observedGeneration of federated resource (Deployment) is smaller than its metadata.generation, meaning that some resource in member cluster have not yet been updated by deployment-controller, which is normal.
Thanks for you work! @veophi

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
@veophi veophi force-pushed the bugfix/deployment-generation branch from fa2364f to 68e7d2f Compare April 25, 2024 13:07
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 25, 2024
@XiShanYongYe-Chang
Copy link
Member

Part of #4870
/kind feature
Hi @veophi, can you help add the release note.

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 25, 2024
@XiShanYongYe-Chang
Copy link
Member

/assign

@veophi veophi force-pushed the bugfix/deployment-generation branch 2 times, most recently from fe73f93 to 64ca576 Compare June 12, 2024 09:04
@XiShanYongYe-Chang
Copy link
Member

XiShanYongYe-Chang commented Jun 12, 2024

This pr has made some updates, can you help to have a look again?
cc @whitewindmills @chaunceyjiang @yike21 @RainbowMango

@veophi veophi changed the title fix: Deployment generation/observedGeneration bug Align federated Deployment's observedGeneration semantics with its native Jun 12, 2024
@veophi veophi force-pushed the bugfix/deployment-generation branch from 64ca576 to 5259f0c Compare June 13, 2024 08:50
pkg/apis/work/v1alpha2/well_known_constants.go Outdated Show resolved Hide resolved
pkg/controllers/binding/common.go Outdated Show resolved Hide resolved
pkg/resourceinterpreter/default/native/status_type.go Outdated Show resolved Hide resolved
pkg/resourceinterpreter/default/native/status_type.go Outdated Show resolved Hide resolved
pkg/resourceinterpreter/default/native/status_type.go Outdated Show resolved Hide resolved
Signed-off-by: 孙伟祥 <sunweixiang@xiaohongshu.com>
@veophi veophi force-pushed the bugfix/deployment-generation branch from 5259f0c to 933343d Compare June 14, 2024 06:06
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 14, 2024
@RainbowMango
Copy link
Member

/lgtm

@XiShanYongYe-Chang @whitewindmills @yike21 Do you have any further comments?

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 14, 2024
@XiShanYongYe-Chang
Copy link
Member

XiShanYongYe-Chang commented Jun 14, 2024

Thanks a lot~
lgtm
We need a release note in the PR description.

@yike21
Copy link
Member

yike21 commented Jun 14, 2024

thanks a lot!
lgtm

@whitewindmills
Copy link
Member

/lgtm

@XiShanYongYe-Chang
Copy link
Member

/lgtm

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.

/approve

Glad we finally made an aggrement!

@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 Jun 17, 2024
@karmada-bot karmada-bot merged commit b624cb8 into karmada-io:master Jun 17, 2024
12 checks passed
@RainbowMango RainbowMango added this to the v1.11 milestone Jun 17, 2024
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants