fix(controller): make managed namespaces more 'prune-proof' (cherry-pick #13999)#15488
Merged
jannfis merged 1 commit intorelease-2.8from Sep 13, 2023
Merged
fix(controller): make managed namespaces more 'prune-proof' (cherry-pick #13999)#15488jannfis merged 1 commit intorelease-2.8from
jannfis merged 1 commit intorelease-2.8from
Conversation
* fix: make managed namespaces more 'prune-proof' 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 take steps 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 though it'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> * refactor: extract managed namespace check Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## release-2.8 #15488 +/- ##
============================================
Coverage 49.95% 49.95%
============================================
Files 263 263
Lines 45061 45080 +19
============================================
+ Hits 22508 22521 +13
- Misses 20345 20349 +4
- Partials 2208 2210 +2
☔ View full report in Codecov by Sentry. |
3 tasks
This was referenced Nov 20, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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