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

labels cannot be deleted via Karmada propagation #4784

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

whitewindmills
Copy link
Member

@whitewindmills whitewindmills commented Mar 30, 2024

What type of PR is this?
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #4781

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

karmada-controller-manager: Fix the problem that labels cannot be deleted via Karmada propagation.

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 30, 2024
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 30, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 80.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 51.77%. Comparing base (6534ffb) to head (ce84edf).

Files Patch % Lines
pkg/util/helper/work.go 0.00% 1 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4784      +/-   ##
==========================================
+ Coverage   51.76%   51.77%   +0.01%     
==========================================
  Files         250      250              
  Lines       24980    24980              
==========================================
+ Hits        12930    12933       +3     
+ Misses      11340    11338       -2     
+ Partials      710      709       -1     
Flag Coverage Δ
unittests 51.77% <80.00%> (+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.

@@ -82,7 +83,6 @@ func CreateOrUpdateWork(client client.Client, workMeta metav1.ObjectMeta, resour
if util.GetLabelValue(runtimeObject.Labels, workv1alpha2.WorkPermanentIDLabel) == "" {
runtimeObject.Labels = util.DedupeAndMergeLabels(runtimeObject.Labels, map[string]string{workv1alpha2.WorkPermanentIDLabel: uuid.New().String()})
}
util.RecordManagedLabels(runtimeObject)
Copy link
Member

Choose a reason for hiding this comment

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

Oh, great find! The workv1alpha2.ManagedLabels should be recorded on the workload rather than the work.

Can you post a screenshot of your fixed test results?

LGTM

/cc @RainbowMango @XiShanYongYe-Chang PTAL.

Copy link
Member

Choose a reason for hiding this comment

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

LGTM
thanks.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you post a screenshot of your fixed test results?

of course.
test label: foo: bar
exam

@XiShanYongYe-Chang
Copy link
Member

Thanks~
/assign

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks~
I think we need to cherry-pick this patch to the preview v1.8 and v1.9, how do you think?

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

@whitewindmills can you help add the release-note?

@whitewindmills
Copy link
Member Author

@XiShanYongYe-Chang done.

@XiShanYongYe-Chang
Copy link
Member

/assign @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.

/approve

@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 Apr 1, 2024
@karmada-bot karmada-bot merged commit ac07d33 into karmada-io:master Apr 1, 2024
12 checks passed
@whitewindmills whitewindmills deleted the fix-managed-labels branch April 1, 2024 12:07
karmada-bot added a commit that referenced this pull request Apr 3, 2024
…-#4784-upstream-release-1.9

Automated cherry pick of #4784: labels cannot be deleted via Karmada propagation
karmada-bot added a commit that referenced this pull request Apr 3, 2024
…-#4784-upstream-release-1.8

Automated cherry pick of #4784: labels cannot be deleted via Karmada propagation
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/bug Categorizes issue or PR as related to a bug. 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.

Unable to sync labels correctly
6 participants