Skip to content

fix(lint): skip POP-105 for GRPC probes (must use port numbers) - #579

Open
beltagyy wants to merge 1 commit into
derailed:masterfrom
beltagyy:fix/grpc-probe-pop105
Open

fix(lint): skip POP-105 for GRPC probes (must use port numbers)#579
beltagyy wants to merge 1 commit into
derailed:masterfrom
beltagyy:fix/grpc-probe-pop105

Conversation

@beltagyy

@beltagyy beltagyy commented Aug 2, 2026

Copy link
Copy Markdown

Problem

POP-105 flags probes that use port numbers with the message "Liveness uses a port#, prefer a named port".

Kubernetes GRPC probes must use port numbers — named ports are
disallowed by the API spec:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.35/#grpcaction-v1-core

This causes a false positive when scanning pods with GRPC
liveness/readiness probes. Issue #570 reported this.

Fix

In checkNamedProbe, return early when p.ProbeHandler.GRPC != nil
before the HTTPGet-based port-number check.

Verification

  • Added GRPCNoIssue test case (liveness+readiness with GRPC ports)
  • All existing internal/lint tests pass
  • go vet clean

Fixes #570

Kubernetes GRPC health probes must use port numbers, not named ports.
The API spec (v1.35+) enforces this: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.35/#grpcaction-v1-core

POP-105 flags probes that use port numbers with the message
"uses a port#, prefer a named port". GRPC probes were incorrectly
flagged because checkNamedProbe only exempted nil HTTP probes.

Fix: checkNamedProbe now returns early when p.ProbeHandler.GRPC != nil,
immediately before the HTTPGet-based port-number check.

Adds "GRPCNoIssue" test case verifying no POP-105 is emitted for
GRPC-based liveness and readiness probes with numeric ports.

Fixes derailed#570
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.

[POP-105] probe must use port number for GRPC

1 participant