when deleting labels in workload annotations, member clusters are not deleted together
What happened: when deleting labels in workload annotations, member clusters are not deleted together,but the annotations in the work have been updated. Add and modify operations are normal.
Environment:
- Karmada version: 1.3
- kubectl-karmada or karmadactl version (the result of
kubectl-karmada versionorkarmadactl version): 1.3 - Others:
Can you tell us how to reproduce it?
when deleting labels in workload annotations, member clusters are not deleted together.
Hi, @luoMonkeyKing I guess you mean that you have deleted a field in the annotation, but the annotation in the member cluster has not been deleted.
This is expected behavior.
https://github.com/karmada-io/karmada/blob/48d9ed11a1f7b36a473a1979fe9b9dfc9cb80aca/pkg/util/objectwatcher/objectwatcher.go#L137-L139
@RainbowMango
Create a deployment and propagate the deployment to the member cluster. The deployment's annotations are as follows:
annotations:
clusters: member1,member2,member3
mapis.ictnj.io/creator: test
aa: bbb
After the creation is successful, delete the aa: bb field of annotations in the deployment. At this time, the deployment in the member cluster will not delete this field synchronously.
when deleting labels in workload annotations, member clusters are not deleted together.
Hi, @luoMonkeyKing I guess you mean that you have deleted a field in the annotation, but the annotation in the member cluster has not been deleted.
This is expected behavior.
https://github.com/karmada-io/karmada/blob/48d9ed11a1f7b36a473a1979fe9b9dfc9cb80aca/pkg/util/objectwatcher/objectwatcher.go#L137-L139
That's what you said, but what's the reason for this design? Is there any other way to delete the annotations field in karmada?
but what's the reason for this design?
I don't know. Maybe @RainbowMango can answer you.
After a resource has been applied to a member cluster, the member cluster will mutate the resource by adding some labels or annotations. That means Karmada needs to adopt the added labels/annotations.
For this case, even though you removed the label from the Karmada control plane, Karmada also gets and adopts the labels from the member cluster. Karmada can't tell if the label is added by the member cluster or removed from the Karmada control plane.
@luoMonkeyKing Can you tell us your use case? Let's see how we can help. For now, I think the ResourceInterprefer maybe a workable solution, but it's way too complicated for this case. :(
@luoMonkeyKing你能告诉我们你的用例吗?让我们看看如何提供帮助。 目前,我认为ResourceInterprefer可能是一个可行的解决方案,但对于这种情况来说它太复杂了。:(
Our use case is very simple, that is, the load information of the member cluster will be displayed on the page. If the annotation and the karmada control plane are inconsistent, it will cause some differences. At present, we have not added some labels or annotations to the member cluster. I want to operate completely through the karmada control surface
hold for a while, let me see how to handle it. by the way, are you evaluating Karmada now or already using it in production?
hold for a while, let me see how to handle it. by the way, are you evaluating Karmada now or already using it in production?
Ok, thank you, we are not in production yet, we are still developing on karmada
I added this issue to release-1.5 backlog, and hope we can solve it in this release.
/assign
/unassign /assign @chaunceyjiang
Thanks @chaunceyjiang for #3099.
@chaunceyjiang Can you summarize your ideas here or in the PR(#3099)?