-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support warnings in webhook utils #1788
Copy link
Copy link
Closed
Description
The admission package supports returning warnings on webhook requests through Response.WithWarnings.
It seems one cannot make use of the utility interfaces and constructors if one wants to respond warnings. So one would end up re-implementing a bunch of the logic.
To not break the existing API, a specific error type could be used which is introspected by the existing utility logic. For an only-warnings error, an Allowed response would be returned.
This could be surfaced through 2 simple functions:
// Triggers an Allowed response with warnings.
func Warnings(...string) error
// Triggers a Denied response with the given error and additional warnings.
func ErrorAndWarnings(error, ...string) errorReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels