-
Notifications
You must be signed in to change notification settings - Fork 635
Add descriptive message to Gateway Programmed condition when no valid… #13152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3d2d562 to
6cd82d0
Compare
|
The unit test failures in this PR are unrelated to my changes. My PR only adds a
These appear to be pre-existing flaky tests or infrastructure issues. |
|
@timflannagan, can you please review it whenever it is possible? |
| "github.com/kgateway-dev/kgateway/v2/pkg/kgateway/wellknown" | ||
| "github.com/kgateway-dev/kgateway/v2/pkg/pluginsdk/ir" | ||
| reports "github.com/kgateway-dev/kgateway/v2/pkg/pluginsdk/reporter" | ||
| reporter2 "github.com/kgateway-dev/kgateway/v2/pkg/pluginsdk/reporter" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| reporter2 "github.com/kgateway-dev/kgateway/v2/pkg/pluginsdk/reporter" | |
| "github.com/kgateway-dev/kgateway/v2/pkg/pluginsdk/reporter" |
can we just use reporter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reporter is already used in the file it can cause redundancy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated validation.go to use the standard reporter package name and renamed the function parameter to rpt to avoid shadowing. This keeps the usage consistent and clean across the codebase.
| reporter.Gateway(gw.Obj).SetCondition(reporter2.GatewayCondition{ | ||
| Type: GatewayConditionAttachedListenerSets, | ||
| Status: metav1.ConditionUnknown, | ||
| Reason: GatewayReasonListenerSetsNotAllowed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be good to also add helpful messages to the other conditions that are missing them (search for SetCondition in this file - i see several are missing a Message)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay got it, I'll definitely do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the messages to the other conditions as well as you suggested
a090cc2 to
4276faa
Compare
6be8403 to
9ce8316
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are upcoming changes in GWAPI regarding the replacement of GatewayConditionAttachedListenerSets with a count of attached listener sets. Let's hold off until they have been finalized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the context! That makes sense. I’ll hold off on this change until the GWAPI updates are finalized and revisit it once the new condition semantics are clear.
|
Thanks for the contribution! It looks like one of the unit tests is failing with this change: https://github.com/kgateway-dev/kgateway/actions/runs/20425389198/job/58684609854?pr=13152#step:5:74839 |
This ensures all Gateway and Listener status conditions provide clear, user-friendly messages explaining their state, improving observability and debuggability. Fixes kgateway-dev#11982 Signed-off-by: Ayush Dwivedi <[email protected]>
722af85 to
157a7cb
Compare
Hey, Thanks for the review i am trying to resolve that issue |
Description
When a Gateway has no valid listeners, the
Programmed=Falsestatus condition shows an empty message, leaving users confused about why their Gateway isn't working. This fix adds a clear, descriptive message to help users understand the issue.Fixes #11982
What Changed
GatewayNoValidListenersMessage = "No valid listeners found for Gateway"Programmed=Falsecondition to use this message instead of leaving it emptyBefore
message: ""
reason: Invalid
status: "False"
type: Programmed
After
message: No valid listeners found for Gateway
reason: Invalid
status: "False"
type: Programmed
Change Type
/kind fix