Skip to content

docs: fix upstream target syntax in examples#5

Merged
raffaelschneider merged 1 commit into
mainfrom
docs/fix-upstream-target-syntax
May 27, 2026
Merged

docs: fix upstream target syntax in examples#5
raffaelschneider merged 1 commit into
mainfrom
docs/fix-upstream-target-syntax

Conversation

@raffaelschneider

Copy link
Copy Markdown
Contributor

Summary

Fixes a long-standing documentation bug surfaced in zentinelproxy/zentinel#254: the quickstart and most other config examples used targets { target { address "X" } }, which neither the single-file nor the multi-file KDL parser actually accepts. Users following the quickstart hit Upstream '...' requires at least one target and had to reverse-engineer the working form.

This PR switches all examples to the form the single-file parser at crates/config/src/kdl/upstreams.rs reads:

upstream "backend" {
    target "host:port"
    target "host:port" weight=2
}

— which is also what many examples in the same docs were already using, so the docs were internally inconsistent (e.g. quick-start.md had both forms on the same page).

Scope

  • 36 files touched across getting-started, configuration, concepts, operations, deployment, development, examples, reference, and appendix.
  • Versioned archives under content/v/25.12, 26.01, 26.02, 26.04, 26.05 are intentionally not changed — those releases actually shipped with the broken syntax in their docs, and rewriting them would falsify the historical record.

Transformations

Before After
target { address "X" } target "X"
target { address "X" weight=N } target "X" weight=N
Multi-line target { address "X"; weight N; max-requests N } target "X" weight=N max-requests=N
targets { ... } wrapper unwrapped (single-file parser ignores it)
targets { } example in directives.md replaced with a meaningful target "127.0.0.1:8080"
target { weight=N } row in HAProxy comparison table target "host:port" weight=N

Helm/Jinja2/envsubst templates in config-management.md and Rust test format-strings in integration-tests.md were also corrected so the templates produce valid KDL.

Not in this PR

Issue #254 has two more reports that are not documentation bugs and need separate fixes in zentinelproxy/zentinel:

  1. /var/log/zentinel permission failure when the official Docker image runs as non-root — needs a container/process fix.
  2. Metrics listener at metrics.address "0.0.0.0:9090" never binds — needs investigation in the proxy.
  3. The user's open question about running two listeners with separate route sets is also out of scope here.

There is also a deeper underlying issue: the single-file parser (crates/config/src/kdl/upstreams.rs) and the multi-file parser (crates/config/src/multi_file/parsers.rs) accept different target syntaxes. That divergence is what made it so easy for docs to drift from reality. Worth a follow-up tracking issue in the proxy repo.

Test plan

  • Render the docs site locally and spot-check getting-started/quick-start.md, configuration/upstreams.md, configuration/namespaces.md, getting-started/installation.md, deployment/docker.md.
  • Copy the quickstart KDL into a zentinel.kdl and confirm zentinel --config zentinel.kdl --check (or --dry-run) succeeds against a current build.
  • Grep content/ (excluding content/v/) for any remaining target { or targets { — should be zero.

The quickstart and most other docs showed `targets { target { address "X" } }`,
which neither the single-file nor the multi-file KDL parser actually accepts.
Switch examples to `target "host:port"` (with optional `weight=N`/`max-requests=N`
as KDL entries) — the form the single-file parser at
crates/config/src/kdl/upstreams.rs reads, and the form already used by many
other examples in the same docs.

Touches 36 files across getting-started, configuration, concepts, operations,
deployment, development, examples, reference, and appendix. Versioned archives
under content/v/ are intentionally left alone.

Refs zentinelproxy/zentinel#254
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying zentinelproxy-io-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2611adc
Status:🚫  Build failed.

View logs

@raffaelschneider raffaelschneider merged commit c07c0dc into main May 27, 2026
2 of 3 checks passed
@raffaelschneider raffaelschneider deleted the docs/fix-upstream-target-syntax branch May 27, 2026 19:33
raffaelschneider added a commit that referenced this pull request Jun 7, 2026
- Snapshot the current top-level docs into `content/v/26.06/` so the
  version picker can serve a frozen 26.06 archive.
- Update `config.toml` version picker: `current = "26.06"`, add a 26.06
  (latest) entry, and demote 26.05 to `/v/26.05/` archive. 26.06 inherits
  the 26.06_1 docs that already landed: metrics endpoint as a dedicated
  listener with non-root logging caveats (#6), upstream `target` syntax
  normalization (#5), and the route-level circuit-breaker / retry-policy
  not-yet-implemented banner (#7).

Refs zentinelproxy/zentinel#254 #255 #256 #258, release 26.06_1 (0.6.15).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant