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

Support List based resources in the KindSortOrder. #12915

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jmajoor
Copy link

@jmajoor jmajoor commented Mar 28, 2024

Fix for #12896

What this PR does / why we need it:

The KindSortOrder maintains 2 lists for InstallOrder and UninstallOrder, which are important to make sure that resources that have dependencies are (un)installed in the correct order without missing their dependencies.

Some List based resources are present, such as SecretList, RoleList, but many are missing such as StatefulList or IngressList.

The PR is needed so you can use List based resources without dependency problems.

Special notes for your reviewer:

The solution here is to automatically create a List entry for each entry of a resource in the InstallOrder.
This will make sure that List equivalents will automatically be supported in the future if new resources are to be added.
Existing List resources have been removed as those are now automatically injected.

The solution also removed the separate Uninstall list and this is now automatically the reverse order of the install list.

If applicable:

  • This PR contains unit tests
    The existing KindSortOrder tests are sufficient. Those are testing several List based resources and those test still pass even though the InstallOrder doesn't register List resources explicitly anymore.
    The Uninstall test needed a modification as the Service resource was uninstalled before a Statefulset, but Statefulset have a dependency on a headless service and should have been deleted first.

…is automatically placed at the same order as their non-list equivalent.

Signed-off-by: Johan Majoor <jmajoor@sparklinglogic.com>
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 28, 2024
Signed-off-by: Johan Majoor <jmajoor@sparklinglogic.com>
@jmajoor
Copy link
Author

jmajoor commented Apr 4, 2024

Changed the usage of "make" to properly specify the length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant