-
Notifications
You must be signed in to change notification settings - Fork 630
agentgateway: report nacks via events #12770
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
agentgateway: report nacks via events #12770
Conversation
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
…an limit the perf damage we're doing here Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
…emaining nacks Signed-off-by: Joe McGuire <[email protected]>
d1de508 to
d93746e
Compare
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
… writing) Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
…nymore Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]> Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: jmcguire98 <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
…ents Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
Signed-off-by: Joe McGuire <[email protected]>
| corev1.EventSource{Component: wellknown.DefaultAgwControllerName}, | ||
| ) | ||
| eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{ | ||
| Interface: client.Kube().CoreV1().Events(""), |
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.
Do we want the events to be cluster-wide? (vs. only being in the gw ns)
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.
When we're initializing the eventbroadcaster we have to give it perms to publish events cluster wide, but when we're actually publishing the events we have to publish them in the same ns as their involvedObject (k8s apiserver requirement)
| UID: deployUID, | ||
| } | ||
|
|
||
| p.eventRecorder.Eventf(gatewayRef, corev1.EventTypeWarning, ReasonNack, event.ErrorMsg) |
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.
Does the ErrorMsg have the type url of the resource in 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.
|
/merge |
|
|
||
| if nackHandler != nil { | ||
| gateway := kgwxds.AgentgatewayID(con.node) | ||
| // Collect resource names from the request only (subscribe/unsubscribe/initial versions) |
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.
on error, agentgateway will not send any sub/unsub/initial version in the request. so this should always be empty afaik
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.
Yeah, that's true.
i think you may have an old version loaded. I ended up getting rid of all this logic

Description
We want to be able to more easily surface to end users cases where configuration they have provided has been translated into config that was rejected (NACKed) by the gateway they were sending it to. In the past this most frequently happened when a user created a policy with illegal CEL which was nacked at the gateway (subsequently we added CEL validation before translating).
To achieve this I have added a NACK publisher that publishes k8s events when an instance of a NACK occurs.
Change Type
/kind new_feature
Changelog
Additional Notes
fixes #12671