Skip to content

Commit 2f7f572

Browse files
committed
Add documentation on setting up live debugging
Adds a short doc on how to set up breakpoints with VSCode through Tilt. Signed-off-by: Tayler Geiger <[email protected]>
1 parent a46ff7d commit 2f7f572

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Local Debugging in VSCode with Tilt
2+
3+
This tutorial will show you how to connect the go debugger in VSCode to your running
4+
kind cluster with Tilt for live debugging.
5+
6+
* Firstly, execute `make run` to spin up a local kind cluster with the current state of your repository.
7+
* Next, execute `tilt up` to start the Tilt service (if using podman, you might need to run `DOCKER_BUILDKIT=0 tilt up`).
8+
9+
Press space to open the web UI where you can monitor the current status of operator-controller and catalogd inside Tilt.
10+
11+
Create a `launch.json` file in your operator-controller repository if you do not already have one.
12+
Add the following configurations:
13+
14+
```json
15+
{
16+
"version": "0.2.0",
17+
"configurations": [
18+
{
19+
"name": "Debug operator-controller via Tilt",
20+
"type": "go",
21+
"request": "attach",
22+
"mode": "remote",
23+
"port": 30000,
24+
"host": "localhost",
25+
"cwd": "${workspaceFolder}",
26+
"trace": "verbose"
27+
},
28+
{
29+
"name": "Debug catalogd via Tilt",
30+
"type": "go",
31+
"request": "attach",
32+
"mode": "remote",
33+
"port": 20000,
34+
"host": "localhost",
35+
"cwd": "${workspaceFolder}",
36+
"trace": "verbose"
37+
},
38+
]
39+
}
40+
```
41+
42+
This creates two "Run and debug" entries in the Debug panel of VSCode.
43+
44+
Now you can start either debug configuration depending on which component you want to debug.
45+
VSCode will connect the debugger to the port exposed by Tilt.
46+
47+
Breakpoints should now be fully functional. The debugger can even maintain its
48+
connection through live code updates.

0 commit comments

Comments
 (0)