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

feat: add permanent id label to pp/cpp/rb/crb/work resources #4474

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

jwcesign
Copy link
Member

@jwcesign jwcesign commented Dec 25, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
Please referring to: #4000 and #4199 (comment)

Which issue(s) this PR fixes:
Part of #4000

Special notes for your reviewer:
The corresponding yaml configuration will be done in another PR.

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 25, 2023
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 25, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.82%. Comparing base (6534ffb) to head (a542ad5).

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4474      +/-   ##
==========================================
+ Coverage   51.76%   51.82%   +0.06%     
==========================================
  Files         250      250              
  Lines       24980    25008      +28     
==========================================
+ Hits        12930    12961      +31     
+ Misses      11340    11338       -2     
+ Partials      710      709       -1     
Flag Coverage Δ
unittests 51.82% <100.00%> (+0.06%) ⬆️

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.

@jwcesign
Copy link
Member Author

Copy link
Member

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 28, 2023
@@ -158,6 +160,8 @@ func Run(ctx context.Context, opts *options.Options) error {
hookServer.Register("/mutate-multiclusterservice", &webhook.Admission{Handler: &multiclusterservice.MutatingAdmission{Decoder: decoder}})
hookServer.Register("/mutate-federatedhpa", &webhook.Admission{Handler: &federatedhpa.MutatingAdmission{Decoder: decoder}})
hookServer.Register("/validate-resourcedeletionprotection", &webhook.Admission{Handler: &resourcedeletionprotection.ValidatingAdmission{Decoder: decoder}})
hookServer.Register("/mutate-resourcebinding", &webhook.Admission{Handler: &resourcebinding.MutatingAdmission{Decoder: decoder}})
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if adding this is reasonable, but it seems it can also be handled in the controller without adding it.

Copy link
Member Author

@jwcesign jwcesign Dec 28, 2023

Choose a reason for hiding this comment

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

It's a little bit complex and difficult to maintain the code in controller, I prefer to add this in weebhook, not in controller

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@chaunceyjiang What's your concern?
I can tell a challenge for the user to update the MutatingWebhookConfiguration during upgrading.

Copy link
Member

Choose a reason for hiding this comment

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

Actually I waiting for @chaunceyjiang about this :)

@chaunceyjiang
Copy link
Member

/cancel lgtm

@RainbowMango
Copy link
Member

It looks good to initialize the label by webhook, however, I think there is no rush to do it. As the label name might be changed.

I feel the label name might not be prefixed with a resource kind, for example, the label name on PropagationPolicy now is:

propagationpolicy.karmada.io/permanent-id: xxxx

But it should be something like:

resource.karmada.io/permanent-id: xxxx

I feel it isn't right for each PP/CPP/RB/CRB/Work to have a dedicated label.

@RainbowMango
Copy link
Member

/hold
for a while.

@karmada-bot karmada-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 4, 2024
@yizhang-zen
Copy link
Contributor

@RainbowMango, any plan to move forward? Is it currently on hold for more discussions? We are waiting for a solution for issue.

@XiShanYongYe-Chang
Copy link
Member

Current progress on the issue: #4683 (comment)

@XiShanYongYe-Chang
Copy link
Member

It looks good to initialize the label by webhook, however, I think there is no rush to do it. As the label name might be changed.

I feel the label name might not be prefixed with a resource kind, for example, the label name on PropagationPolicy now is:

propagationpolicy.karmada.io/permanent-id: xxxx

But it should be something like:

resource.karmada.io/permanent-id: xxxx

I feel it isn't right for each PP/CPP/RB/CRB/Work to have a dedicated label.

If we want to change the label name, we can remove the previously used namespace/name related labels at least in the next version (v1.11), and solve the problem described in #4000. Is this progress as expected?

@RainbowMango
Copy link
Member

If we want to change the label name, we can remove the previously used namespace/name related labels at least in the next version (v1.11), and solve the problem described in #4000. Is this progress as expected?

Yeah, thanks for the reminder. Let's move forward and if we decide to rename the label in the future, we can run another deprecation cycle.

@RainbowMango
Copy link
Member

@jwcesign Can you help to rebase this PR?

And, shall we update the MutatingWebhookConfiguration along with this?

@XiShanYongYe-Chang
Copy link
Member

This PR is missing the webhook-configuration file.

@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2024
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 Mar 30, 2024
@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 Mar 30, 2024
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2024
@RainbowMango
Copy link
Member

@XiShanYongYe-Chang The test is failing, please take a look.

@XiShanYongYe-Chang
Copy link
Member

@XiShanYongYe-Chang The test is failing, please take a look.

I'm working on it.

@XiShanYongYe-Chang
Copy link
Member

The current PR can be pushed after the modification of karmadactl init in #4789 is complete.

Signed-off-by: jwcesign <jwcesign@gmail.com>
@XiShanYongYe-Chang
Copy link
Member

/cc @RainbowMango It is ready to merge now.

@RainbowMango
Copy link
Member

Uh, please propose a release notes...
And this must be something that should be put in upgrading docs, do we have a task for it?

@XiShanYongYe-Chang
Copy link
Member

Uh, please propose a release notes...

How about add permanentID label for PP/CPP/RB/CRB/Work resources in karmada-webhook?

And this must be something that should be put in upgrading docs, do we have a task for it?

I added a sub-task to the task item of #4711 to describe this.

@XiShanYongYe-Chang
Copy link
Member

/cc @RainbowMango

@XiShanYongYe-Chang
Copy link
Member

Kindly ping @RainbowMango @chaunceyjiang

@XiShanYongYe-Chang
Copy link
Member

/assign @chaunceyjiang @RainbowMango

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

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2024
@RainbowMango
Copy link
Member

/hold cancel

@karmada-bot karmada-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 30, 2024
@karmada-bot karmada-bot merged commit f33f3f8 into karmada-io:master Apr 30, 2024
13 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. 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

7 participants