Skip to content

Commit ee5f201

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 4b7a59b commit ee5f201

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

DEVELOPMENT.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,44 @@ If you made any changes to CRDs API, you can update CRDs API reference doc by
5252

5353
```bash
5454
make api-docs
55-
```
55+
```
56+
57+
## Debugging the controller locally
58+
59+
When reproducing an issue or stepping through reconciliation logic, the
60+
following knobs make local runs cheaper and the resulting logs easier to
61+
read.
62+
63+
### Limit the watched namespace
64+
65+
The controller watches every namespace by default. To narrow it to a single
66+
namespace, set the `RUNTIME_NAMESPACE` environment variable before invoking
67+
`make run`:
68+
69+
```sh
70+
RUNTIME_NAMESPACE=flux-system make run
71+
```
72+
73+
### Reduce reconcile concurrency
74+
75+
Each `ImageRepository` and `ImagePolicy` reconcile is processed concurrently
76+
(default `--concurrent=4`). When debugging it is almost always easier to
77+
follow a serial trace; pass `--concurrent=1` so reconciles run one at a
78+
time:
79+
80+
```sh
81+
go run ./main.go --concurrent=1
82+
```
83+
84+
### Suspend unrelated objects
85+
86+
If the controller is sharing a cluster with other Flux objects, suspend
87+
anything not relevant to the test you're running so their reconciles don't
88+
interleave with yours:
89+
90+
```sh
91+
flux suspend image repository <name>
92+
flux suspend image policy <name>
93+
```
94+
95+
Resume with `flux resume image repository|policy <name>` when you're done.

0 commit comments

Comments
 (0)