Skip to content

ResolvedRefs error not helpful when ref'ing to incorrect port on Service #11998

@lgadban

Description

@lgadban

kgateway version

main

Kubernetes Version

n/a

Describe the bug

Need to confirm but found in translator test, having a backendRef to a service but the incorrect port results in an error like

condition error for httproute: default/foo-route ref: 0 condition: {ResolvedRefs False 0 2025-08-13 21:13:46.740397 -0500 CDT m=+0.687139126 BackendNotFound Service "foo-svc" not found}

In this case foo-svc does exist it just refers to an incorrect port

Expected Behavior

The error message should not the service does not exist, because it does, but have some sort of pointer that it's related to the port.

Steps to reproduce the bug

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: foo-route
spec:
  parentRefs:
  - name: foo-listenerset
    group: gateway.networking.x-k8s.io
    kind: XListenerSet
  hostnames:
  - "foo.example.com"
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: foo-svc
      port: 800
---
apiVersion: v1
kind: Service
metadata:
  name: foo-svc
spec:
  selector:
    test: test
  ports:
    - protocol: HTTP
      port: 8080
      targetPort: test

Additional Environment Detail

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions