-
Notifications
You must be signed in to change notification settings - Fork 115
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
External changes to labels and annotations aren't reverted with server side apply. #2331
Comments
Hi @bernhardloos and thanks for reporting this. At the moment, this is expected behaviour since with SSA enabled, we do not force an override for any conflicts with an existing version of the resource. To enable this, you'll need to append the Additional materials:Please refer to our documentation about upserting a resource for more information: #2011 also documents the design decisions behind SSA implementation within our provider. #2280 is an enhancement request to enable patchForce on a stack basis, rather than per-resource basis. |
As far as I can tell, patchForce deals with conflicts via managedFields, but this is not the case here. The annotation or label is simply gone, no conflict. Unsurprisingly, setting the annotation patchForce didn't change the behavior in any way. Also, the missing annotation or label will get recreated without any problems if I make any change to the resource (even unrelated parts) in pulumi. @rquitales would you please consider reopening this? |
Ah! When I tried to reproduce this locally, I mistakenly combined adding Yes, this does appear to be an issue we need to address. |
Tracked down this issue to 2 bugs, one within our codebase, the other is an upstream issue. Firstly, when we merge our client-side patch with server-side patch, we need to ensure that empty values are also removed when merging. Secondly, there is a bug in upstream imdario/mergo that does not merge maps properly. I have filled a bug issue and PRs to address these. |
When merging client-side and server-side patches for diffing, we need to remove any empty/removed keys from the server-side patch in the client-side patch as well. Fixes: #2331
When merging client-side and server-side patches for diffing, we need to remove any empty/removed keys from the server-side patch in the client-side patch as well. Fixes: #2331
When merging client-side and server-side patches for diffing, we need to remove any empty/removed keys from the server-side patch in the client-side patch as well. Fixes: #2331
When merging client-side and server-side patches for diffing, we need to remove any empty/removed keys from the server-side patch in the client-side patch as well. Fixes: #2331
When merging client-side and server-side patches for diffing, we need to remove any empty/removed keys from the server-side patch in the client-side patch as well. Fixes: #2331
* fix: Remove empty keys when merging unstructured resources When merging client-side and server-side patches for diffing, we need to remove any empty/removed keys from the server-side patch in the client-side patch as well. Fixes: #2331 * test: Add integration test for SSA updating empty labels/annotations
@rquitales could you clarify what the expected behaviour is when |
@colinbankier The behaviour should be the same either CSA or SSA is used. It looks like this is also an issue for non-server side apply as well. Could you file a new issue for this and we'll work on resolving this issue. Thanks. |
What happened?
I manually removed a label or annotations from a kubernetes resource managed pulumi. Pulumi notices it in refresh, but then it doesn't repair the missing annotation or label on up and doesn't indicate any differences on subsequent runs.
A changed value gets repaired as expected.
Also, I didn't try this without server side apply.
Expected Behavior
Pulumi should revert all external changes and restore resources to the configured state.
Steps to reproduce
Output of
pulumi about
CLI
Version 3.56.0
Go Version go1.20.1
Go Compiler gc
Plugins
NAME VERSION
kubernetes 3.24.1
kubernetes_crds 0.0.0
python unknown
tls 4.10.0
Host
OS fedora
Version 37
Arch x86_64
This project is written in python: executable='/usr/bin/python3' version='3.11.1'
Dependencies:
NAME VERSION
pip 22.2.2
pulumi-kubernetes 3.24.1
pulumi-kubernetes-crds 0.0.0
pulumi-tls 4.10.0
setuptools 62.6.0
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: