Skip to content

Default perf ports when the Perf block is partially specified - #43

Open
caseydavenport wants to merge 1 commit into
mainfrom
casey-perf-port-defaults
Open

Default perf ports when the Perf block is partially specified#43
caseydavenport wants to merge 1 commit into
mainfrom
casey-perf-port-defaults

Conversation

@caseydavenport

Copy link
Copy Markdown
Member

A test config that supplies a Perf block without ports fails about 20 seconds into the run, when the apiserver rejects the test policy for having port 0. The defaults were only applied when Perf was missing entirely, so a block that set direct/service and nothing else left both ports at zero.

Ports are now defaulted per-field for non-external tests. External tests still require them explicitly, since the test tools don't work through NAT and the ports have to match whatever the service is exposed on.

The range checks moved out of the external-only branch too, so an out-of-range port is caught at config load instead of part way into a run.

Found while setting up an iptables/nftables comparison, where the config that triggered it was just direct: true, service: true, external: false - which is what the defaults already are.

The ports were only defaulted when Perf was absent entirely, so a config that
set direct/service but left the ports out reached the dataplane with port 0 and
the apiserver rejected the test policy. Move the range checks out of the
external-only branch too, so a bad port fails at config load rather than 20
seconds into a run.
@caseydavenport caseydavenport added bug Something isn't working safe to test labels Jul 29, 2026
@caseydavenport
caseydavenport requested a review from lwr20 July 29, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working safe to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant