Skip to content

Commit 6abb29f

Browse files
committed
docs: add debugging tips to DEVELOPMENT.md
Adds a 'Debugging the controller locally' section covering knobs that are not already in 'How to run the controller locally': - RUNTIME_NAMESPACE to scope the watch - --concurrent=1 to serialize reconciles for a clean trace - flux suspend for unrelated objects sharing the cluster Assisted-by: Claude/claude-opus-4-7 Signed-off-by: alliasgher <alliasgher123@gmail.com>
1 parent 070e99b commit 6abb29f

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

DEVELOPMENT.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,42 @@ Create a `.vscode/launch.json` file:
104104

105105
Start debugging by either clicking `Run` > `Start Debugging` or using
106106
the relevant shortcut.
107+
108+
109+
## Operational debugging tips
110+
111+
When reproducing an issue or stepping through reconciliation logic, the
112+
following knobs make local runs cheaper and the resulting logs easier to
113+
read.
114+
115+
### Limit the watched namespace
116+
117+
The controller watches every namespace by default. To narrow it to a single
118+
namespace, set the `RUNTIME_NAMESPACE` environment variable before invoking
119+
`make run`:
120+
121+
```sh
122+
RUNTIME_NAMESPACE=flux-system make run
123+
```
124+
125+
### Reduce reconcile concurrency
126+
127+
Each `ImageUpdateAutomation` reconcile is processed concurrently (default
128+
`--concurrent=4`). When debugging it is almost always easier to follow a
129+
serial trace; pass `--concurrent=1` so reconciles run one at a time:
130+
131+
```sh
132+
go run ./main.go --concurrent=1
133+
```
134+
135+
### Suspend unrelated objects
136+
137+
If the controller is sharing a cluster with other Flux objects, suspend
138+
anything not relevant to the test you're running so their reconciles don't
139+
interleave with yours:
140+
141+
```sh
142+
flux suspend image update <name>
143+
```
144+
145+
Resume with `flux resume image update <name>` when you're done.

0 commit comments

Comments
 (0)