Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,44 @@ If you made any changes to CRDs API, you can update CRDs API reference doc by

```bash
make api-docs
```
```

## Debugging the controller locally

When reproducing an issue or stepping through reconciliation logic, the
following knobs make local runs cheaper and the resulting logs easier to
read.

### Limit the watched namespace

The controller watches every namespace by default. To narrow it to a single
namespace, set the `RUNTIME_NAMESPACE` environment variable before invoking
`make run`:

```sh
RUNTIME_NAMESPACE=flux-system make run
```

### Reduce reconcile concurrency

Each `ImageRepository` and `ImagePolicy` reconcile is processed concurrently
(default `--concurrent=4`). When debugging it is almost always easier to
follow a serial trace; pass `--concurrent=1` so reconciles run one at a
time:

```sh
go run ./main.go --storage-path=./data --concurrent=1
```

### Suspend unrelated objects

If the controller is sharing a cluster with other Flux objects, suspend
anything not relevant to the test you're running so their reconciles don't
interleave with yours:

```sh
flux suspend image repository <name>
flux suspend image policy <name>
```

Resume with `flux resume image repository|policy <name>` when you're done.