-
Notifications
You must be signed in to change notification settings - Fork 910
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
merge labels when building RB/CRB by ClusterPropagationPolicy #3239
Conversation
Signed-off-by: lxtywypc <lxtywypc@gmail.com>
@@ -523,7 +523,7 @@ func (d *ResourceDetector) ApplyClusterPolicy(object *unstructured.Unstructured, | |||
"try again later after binding is garbage collected, see https://github.com/karmada-io/karmada/issues/2090") | |||
} | |||
// Just update necessary fields, especially avoid modifying Spec.Clusters which is scheduling result, if already exists. | |||
bindingCopy.Labels = binding.Labels | |||
bindingCopy.Labels = util.DedupeAndMergeLabels(bindingCopy.Labels, binding.Labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we don't need to modify this line, because we don't currently support cluster scope resources for the dependency distribution feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, this is not just for the dependency distribution feature, but customized labels as well.
For example, if we have a webhook which would patch some custmized info into the labels of resourcebindings to group them, after I scale the workload once, the info would be lost.
This might not be a good example, but I think even if it is a label for temporary usage, we shouldn't abandon them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable., and it doesn't seem to hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should add some E2E to protect this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm......I think it is nice to have.
I hope to help add some.
May I commit them in this PR? Or open a new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assign
/retitle merge labels when building RB/CRB by ClusterPropagationPolicy |
Hi @XiShanYongYe-Chang |
Done, refer to #3265 Hi @lxtywypc, you can sign it to you by the command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[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 |
merge labels when building RB/CRB by ClusterPropagationPolicy
What type of PR is this?
/kind bug
What this PR does / why we need it:
Merge labels in (cluster)resourcebinding when the binding is modifying no matter which kind of propagationpolicy is bind with.
Which issue(s) this PR fixes:
Fixes #3238
Special notes for your reviewer:
Does this PR introduce a user-facing change?: