fix(controller): make managed namespaces more 'prune-proof' (cherry-pick #13999) #15488
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-picked fix(controller): make managed namespaces more 'prune-proof' (#13999)
In the cases where someone would want to set resource tracking on a
managed namespace, or if someone would want to migrate from having a
namespace in Git to using
managedNamespaceMetadata
, we need to takesteps to ensure that the namespace does not get pruned.
In order to do that, we add the live namespace to the list of
targetObjs
(so that it's considered a part of the source even thoughit's not).
Finally, we need to also ensure that the managed namespace is not
considered
OutOfSync
(due to the same reason as above).This is a subset of #11350, the main difference being that this commit
does not set resource tracking on its own, but can be opted into if
people choose to do so.
Signed-off-by: Blake Pettersson blake.pettersson@gmail.com
Signed-off-by: Blake Pettersson blake.pettersson@gmail.com
Signed-off-by: Blake Pettersson blake.pettersson@gmail.com