Skip to content
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

fix(controller): make managed namespaces more 'prune-proof' (cherry-pick #13999) #15488

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

gcp-cherry-pick-bot[bot]
Copy link

Cherry-picked fix(controller): make managed namespaces more 'prune-proof' (#13999)

  • 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

* 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
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 60.00% and no project coverage change.

Comparison is base (7b89ae4) 49.95% compared to head (6d88362) 49.95%.
Report is 1 commits behind head on release-2.8.

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     
Files Changed Coverage Δ
controller/state.go 70.92% <60.00%> (-0.41%) ⬇️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants