-
Notifications
You must be signed in to change notification settings - Fork 95
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
Label removal from wrapped object does not trigger label removal on managed cluster #367
Comments
we use openshift/library-go to apply resources, the label is always merged. see mergemap here https://github.com/openshift/library-go/blob/master/pkg/operator/resource/resourcemerge/object_merger.go#L141 To remove the label, you will need to explicitly set it by adding a "-" suffix, e.g.
|
From looking at https://github.com/openshift/library-go/blob/master/pkg/operator/resource/resourcemerge/object_merger.go#L141 , I can see that the key is checked for "-" suffix, not the value. |
/assign |
This issue is stale because it has been open for 120 days with no activity. After 14 days of inactivity, it will be closed. Remove the |
This issue is stale because it has been open for 120 days with no activity. After 14 days of inactivity, it will be closed. Remove the |
Describe the bug
When label is removed from an object wrapped by
ManifestWork
, it is not removed from the object in the managed cluster.To Reproduce
kubectl
to create aManifestWork
on the hub with the following yaml file. Note thetest: test
label in the deployment metadata.nginx-deployment
in cluster1 is labeled with the test labelkubectl --context kind-cluster1 get deployment nginx-deployment -o yaml
ManifestWork
and remove the test label.kubectl --context kind-hub edit manifestworks my-first-work -n cluster1
nginx-deployment
in cluster1 is still labeled with the test label.Expected behavior
In step 6 above, I expect the test label to be removed.
Environment ie: OCM version, Kubernetes version and provider:
kind v0.19.0 go1.19 linux/amd64
Additional context
Add new label and update a label value works as expected.
The text was updated successfully, but these errors were encountered: