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

Make run eases local interactive tests #1566

Merged
merged 1 commit into from May 17, 2024
Merged

Make run eases local interactive tests #1566

merged 1 commit into from May 17, 2024

Conversation

josvazg
Copy link
Collaborator

@josvazg josvazg commented May 8, 2024

Using make run RUN_YAML=my-k8s-ako-sample-here.yml you get:

  • A local kind cluster to run...
  • A freshly compiled manager with latest changes in the current terminal process.
  • The RUN_YAML file applied after the CRDs are installed and the manager is started, so it will try to enforce the given state.
    No need for ad-hoc scripts to get the same.

It relies on:

  • make install-crds to install the latest versions of the CRDs.
  • make install-credentials to create the root Atlas Operator credentials secret off your MCLI_ env vars. Remember to have those setup in advance in your terminal.
    • The set-namespace rule ensures the namespace set by $(OPERATOR_NAMESPACE) is in place.

If RUN_YAML is not passed in, make run will only launch the manager binary without any initial Kubernetes definitions in place. You should go to another terminal to apply Kubernetes YAMLs.

You can call make run ... several times in a row but, depending on your testing state, you might find issues with leftover state in Kubernetes or Atlas. To wipe prior Kubernetes state you can do 'make stop-kindandmake run` will relaunch kind on its own.

All Submissions:

  • Have you signed our CLA?

@helderjs
Copy link
Collaborator

It's a simple and smart way to approach the problem, great idea!
Why not include a clean-up, even as simple as stop kind, to avoid conflicts with leftovers? Do you think is better to deal with it manually?

@josvazg
Copy link
Collaborator Author

josvazg commented May 10, 2024

It's a simple and smart way to approach the problem, great idea! Why not include a clean-up, even as simple as stop kind, to avoid conflicts with leftovers? Do you think is better to deal with it manually?

We already have make stop-kind which effectively wipes it all clean, at least from the Kubernetes side of things. I use it all the time.

Cleaning up the YAML as well is a bit more tricky, and just an apply away for the developer. Most of interactive tests will require several steps and kubectl apply/delete even before the cleanup.

Signed-off-by: jose.vazquez <jose.vazquez@mongodb.com>
@josvazg josvazg merged commit 36ca559 into main May 17, 2024
9 checks passed
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.

None yet

2 participants