Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Conversation

adrianludwin
Copy link
Contributor

This change makes it a nondestructive operation to switch a namespace
from managed to unmanaged and back, by not deleting the HC or anchors
while a namespace is unmanaged. It also fixes one serious bug
(namespaces could not be changed to roots because the unnamed namespace
didn't match the regex) and adds a lot more details in the error
messages. Finally, it allows users to fix broken hierarchies by removing
a formerly-managed parent.

I also changed the terminology from "excluded" to "unmanaged"
throughout.

Testing: This is hard to test automatically since it requires constant
redeployments of HNC. So I did extensive manual testing instead:

  • Try to arrange hierarchies with unmanaged namespace, both excluded
    (e.g hnc-system) and ones that don't match the regex. Verify that the
    error messages clearly indicate the correct problem.
  • Create a legal hierarchy and then break it by changing the regex.
    Verify that I can fix it without restarting HNC.
  • Create a legal hierarchy, break it with the regex, and then restore it
    with the regex. Verify that the original hierarchy comes back.
  • Verify that anchors and hierarchyconfigs lose their finalizers when
    their namespaces become unmanaged, and get them back if they become
    managed again.

This change makes it a nondestructive operation to switch a namespace
from managed to unmanaged and back, by _not_ deleting the HC or anchors
while a namespace is unmanaged. It also fixes one serious bug
(namespaces could not be changed to roots because the unnamed namespace
didn't match the regex) and adds a lot more details in the error
messages. Finally, it allows users to fix broken hierarchies by removing
a formerly-managed parent.

I also changed the terminology from "excluded" to "unmanaged"
throughout.

Testing: This is hard to test automatically since it requires constant
redeployments of HNC. So I did extensive manual testing instead:

* Try to arrange hierarchies with unmanaged namespace, both excluded
(e.g hnc-system) and ones that don't match the regex. Verify that the
error messages clearly indicate the correct problem.
* Create a legal hierarchy and then break it by changing the regex.
Verify that I can fix it without restarting HNC.
* Create a legal hierarchy, break it with the regex, and then restore it
with the regex. Verify that the original hierarchy comes back.
* Verify that anchors and hierarchyconfigs lose their finalizers when
their namespaces become unmanaged, and get them back if they become
managed again.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 12, 2021
@adrianludwin
Copy link
Contributor Author

/assign @rjbez17
cc @santinoncs

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 12, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 12, 2021
@santinoncs
Copy link
Contributor

LGTM

@adrianludwin
Copy link
Contributor Author

Ping @rjbez17 ?

@adrianludwin adrianludwin added this to the release-v0.9 milestone Oct 13, 2021
@rjbez17
Copy link
Contributor

rjbez17 commented Oct 13, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 13, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5eb827d into kubernetes-retired:master Oct 13, 2021
@adrianludwin adrianludwin deleted the managed branch March 24, 2022 14:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants