-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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) error
Metadata
Metadata
Assignees
Labels
No labels