Skip to content

[validators] Reject unsupported validators - #1407

Merged
manugarg merged 3 commits into
cloudprober:mainfrom
Guflly:fix/reject-invalid-validators
Sep 10, 2026
Merged

manugarg merged 3 commits into
cloudprober:mainfrom
Guflly:fix/reject-invalid-validators

Conversation

@Guflly

@Guflly Guflly commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Rejects probe-specific validators when they are configured for incompatible probe types, instead of letting them fail silently at runtime.

The validation runs in BuildProbeOptions and covers HTTP, DNS, UDP, and UDP listener combinations.

Tests:

  • go test ./probes/options
  • go vet ./probes/options
  • go build ./probes/options

Fixes #1397

Comment thread probes/options/options.go Resolved
Comment thread probes/options/options.go Resolved
Comment thread probes/options/options.go Resolved
Comment thread probes/options/options_test.go Resolved

@manugarg manugarg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic and tests look solid, but the validatorTypeName + validatorProbeTypes split adds a layer of indirection that isn't earning its keep. Please collapse it before merging — see inline comment.

Comment thread probes/options/options.go Resolved
@manugarg

Copy link
Copy Markdown
Contributor

Thanks for the fix, @Guflly! Since this had been idle for a while, I pushed the last review change (collapsing validatorTypeName and the validatorProbeTypes map into a single switch) directly onto the branch so we can get it merged.

@manugarg
manugarg merged commit 7201b07 into cloudprober:main Sep 10, 2026
11 checks passed
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.

Reject probe-type-specific validators at config time

2 participants