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

test(reconcile): simulate controllers with custom client #510

Merged
merged 4 commits into from
Dec 22, 2022

Conversation

ebaron
Copy link
Member

@ebaron ebaron commented Dec 21, 2022

This PR moves the logic for updating certificate and route statuses from reconcileCryostatFully to a custom client implementation. This client triggers the update upon the first successful Get call. This happens after the object has been created, so we're still exercising the RequeueAfter code paths.

The advantage here is that we can simplify how we do reconciles in the tests themselves. I've changed reconcileCryostatFully to use Gomega's Eventually to call Reconcile asynchronously until it no longer re-queues or times out. This allows us to use reconcileCryostatFully in more places.

I also removed an unnecessary Get call for the certificate in common/tls.go. We already have the certificate in memory, and this was triggering the certificate update logic earlier than desired.

Fixes: #509

Copy link
Member

@andrewazores andrewazores left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

@ebaron ebaron merged commit 55e201b into cryostatio:main Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Reconciling in tests should be more flexible
2 participants