Debug Kubernetes Operator-sdk locally in Goland
This is a follow on from this article setting up the operator-sdk debug in vscode.
Setup Goland to debug
The setup for Goland is pretty similar to Vscode.
Delve is a debug tool for golang, it can be downloaded here or by just using go
go get -u github.com/go-delve/delve/cmd/dlv
In Goland go to `Run\Edit Configurations…`
Click on the Plus symbol `+` and add `Go Remote` add a Name and click `Apply` the defaults are fine
You need to run delve with the command line switch `enable-delve` on the `up local` command
e.g. The operator I am working on is called `integreatly-operator` so the commands to run it are as follows
NOTE: command changed with v0.15.0
operator-sdk run --local --namespace=integreatly-operator
Click on `Run\Debug ‘whatYouCallYourGoRemote’`
Goland will start to debug and stop at your breakpoints.