You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
probe validation errors get the wrong path when more than one handler is set #16817
if a probe has more than one handler and one of them is invalid, the error for that handler should point at that handler, e.g. spec.template.spec.containers[0].readinessProbe.httpGet.port
Actual Behavior
the path gets the other handler names glued on in front. with httpGet on a wrong port name + tcpSocket:
expected exactly one, got both: spec.template.spec.containers[0].readinessProbe.httpGet, spec.template.spec.containers[0].readinessProbe.tcpSocket
invalid value: wrong: spec.template.spec.containers[0].readinessProbe.tcpSocket.httpGet.port
Probe port must match container port
and if exec and grpc are set too it turns into readinessProbe.grpc.exec.httpGet.port
the cause is in validateProbe in pkg/apis/serving/k8s_validation.go, the ViaField("httpGet"), ViaField("tcpSocket"), ViaField("exec") and ViaField("grpc") are called on the result of errs.Also(...) so they get applied to every error collected so far, not just that handler's errors. same thing as #16790 but for probes
small extra thing in the same function: the "got both" error calls the grpc handler gRPC while the field is grpc (and the "got neither" error right below already says grpc)
Steps to Reproduce the Problem
create a Service with a readiness probe that has httpGet with port: wrong and also tcpSocket: {}
look at the error path above
found it while reading the code, reproduced with Service.Validate in a unit test, not on a cluster
Activity
Itx-Psycho0 commentedon Nov 25, 2026
/assign