-
Is there a way to debug the tests while developing a Kubernetes Operator? For instance, I have the following files with the same package
And then, as usual, I have the Running I've currently tried a couple of ways to attach a debugger:
I'm happy to share any more details. Any ideas as to how I can debug this? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
For you to debug with GolangIDEA, you can just run the make targets manually to ensure that all is generated and execute the controller suite test (suite_test.go) from the IDEA in debug mode. You can also update the ENV TEST config to run it against an existent cluster instead of use the binaries, see: https://github.com/kubernetes-sigs/controller-runtime/blob/6747c42ce33966b0e77cac278c6b9087cc2f51c7/pkg/envtest/server.go#L149-L152 |
Beta Was this translation helpful? Give feedback.
-
Hi @ArpanSriv Did it worked for you? Would you like to add a summary of how you achieve it and close this one? |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the suggestions @camilamacedo86. I tried setting the env variable ( Unfortunately, I was not able to make it work with Currently I am occupied with higher-priority projects, so I am out of time to spend on this. We can close it for now :) |
Beta Was this translation helpful? Give feedback.
Thanks for all the suggestions @camilamacedo86. I tried setting the env variable (
KUBEBUILDER_ASSETS
) but it doesn't seem to work.Unfortunately, I was not able to make it work with
UseExistingCluster = false
.Currently I am occupied with higher-priority projects, so I am out of time to spend on this. We can close it for now :)