Skip to content

Conversation

@yaten2302
Copy link

Description

Fixes #11998

Currently, if the user adds an incorrect port in the service, it results in an err like this:

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}

But, since, the service exists, the err should be something like this:

Service foo-svc found, but port 800 not defined

Change Type

/kind bug_fix

Changelog

fix: ResolvedRefs error not helpful when ref'ing to incorrect port on Service

Additional Notes

@yaten2302
Copy link
Author

Hi @npolshakova , apologies for the delay on this, I've made the suggested changes, with all the unit tests passing, kindly check :)

@yaten2302
Copy link
Author

Hi @npolshakova , did you get time to review this 👀 ?

}
}
if found {
return nil, &BackendPortNotFoundError{Port: port, BackendName: n.Name, Namespace: n.Namespace}
Copy link
Contributor

Choose a reason for hiding this comment

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

you also need to account for alias logic below (see the call to getBackendFromAlias) - do the error logic if getBackendFromAlias fails

Copy link
Author

Choose a reason for hiding this comment

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

Isn't the error logic already there - https://github.com/kgateway-dev/kgateway/pull/13178/changes#diff-9760745752b7c20a2c9236474a1a5c82973b1399cbd0bd814e67a1ace8997c2dR270-R271 ?
Correct me if I'm wrong here, I didn't fully understand this comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants