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

Rework orphaned Templates removal #571

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

eromanova
Copy link
Contributor

@eromanova eromanova commented Oct 29, 2024

Closes #570

Includes:

  • Remove managed-by-chain label from templates since one template can be managed by multiple chains and this label is not needed anymore
  • Remove managed templates deletion part from the template chain controller
  • Add owner reference on managed templates
  • Other template chain controller code improvements
  • Adapt testing accordingly

@eromanova eromanova self-assigned this Oct 29, 2024
@eromanova eromanova force-pushed the rework-templates-removal branch from 6f76152 to 691e70e Compare November 4, 2024 11:00
@eromanova eromanova requested a review from zerospiel November 5, 2024 12:08
Copy link
Contributor

@zerospiel zerospiel left a comment

Choose a reason for hiding this comment

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

I left a couple of nit comments along with a couple of questions.

And one more question: why do we implement the full reconciliation test logic in the BeforeEach and AfterEach nodes? The logic in those might interfere with other tests (e.g. removing a namespace in one of the AfterEach node, whilst the same namespace is being utilized by another node from another test). This question does not require any actions to perform, I am just curious about it

internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
internal/controller/templatechain_controller.go Outdated Show resolved Hide resolved
@eromanova eromanova marked this pull request as draft November 5, 2024 14:16
@eromanova eromanova force-pushed the rework-templates-removal branch from 8b32df0 to b12a2f3 Compare November 5, 2024 17:29
@eromanova
Copy link
Contributor Author

Very big thanks for the review @zerospiel. Regarding your question about the reconciliation tests logic, I think we should create a task for it and continue the discussion there. I'd agree, the current reconciliation tests approach may be reworked.

@eromanova eromanova force-pushed the rework-templates-removal branch from b12a2f3 to d617632 Compare November 6, 2024 08:23
@eromanova eromanova marked this pull request as ready for review November 6, 2024 08:23
zerospiel
zerospiel previously approved these changes Nov 6, 2024
@eromanova eromanova marked this pull request as draft November 7, 2024 13:54
@eromanova eromanova force-pushed the rework-templates-removal branch 2 times, most recently from 7e3e42b to c59fc89 Compare November 7, 2024 16:26
@eromanova eromanova marked this pull request as ready for review November 7, 2024 16:32
@eromanova eromanova requested a review from Kshatrix November 7, 2024 16:32
zerospiel
zerospiel previously approved these changes Nov 7, 2024
@eromanova eromanova force-pushed the rework-templates-removal branch from c59fc89 to b85ed80 Compare November 8, 2024 14:11
@eromanova eromanova requested a review from squizzi as a code owner November 8, 2024 14:11
@eromanova eromanova force-pushed the rework-templates-removal branch 3 times, most recently from 0b34261 to 955ccfc Compare November 8, 2024 17:09
Closes k0rdent#570

Includes:
* Remove managed-by-chain label from templates since one template
  can be managed by multiple chains
* Trigger TemplateChain reconciliation on TemplateManagement updates
* Use cached k8s client in testing for operations that require field indexers
  since field indexers are only work with cached client
* Separate TemplateChain reconciliation to Update and Delete operations
@eromanova eromanova force-pushed the rework-templates-removal branch from 955ccfc to e2acc45 Compare November 8, 2024 17:17
@eromanova eromanova marked this pull request as draft November 10, 2024 10:13
@eromanova eromanova force-pushed the rework-templates-removal branch from e2acc45 to 3566f95 Compare November 10, 2024 10:46
@eromanova eromanova marked this pull request as ready for review November 10, 2024 10:50
@Kshatrix Kshatrix merged commit 55bf573 into k0rdent:main Nov 11, 2024
5 checks passed
@eromanova eromanova deleted the rework-templates-removal branch November 11, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Rework orphaned Templates removal process
3 participants