Documentation ¶
Index ¶
- Constants
- func NewContextWithRequestPath(ctx context.Context, r *http.Request) context.Context
- func RequestPathFromContext(ctx context.Context) (string, error)
- func RingForRequest(ctx context.Context, c client.Reader) (sharding.Ring, error)
- func RingForWebhookPath(requestPath string) (sharding.Ring, error)
- func WebhookPathFor(obj client.Object) (string, error)
- type Handler
Constants ¶
View Source
const ( // HandlerName is the name of the webhook handler. HandlerName = "sharder" // WebhookPathPrefix is the path prefix at which the handler should be registered. WebhookPathPrefix = "/webhooks/sharder/" )
Variables ¶
This section is empty.
Functions ¶
func NewContextWithRequestPath ¶
NewContextWithRequestPath augments the given context with the request's path.
func RequestPathFromContext ¶
RequestPathFromContext returns the request's path stored in the given context.
func RingForRequest ¶
RingForRequest returns the Ring object matching the requests' path.
func RingForWebhookPath ¶
RingForWebhookPath returns the ring object that is associated with the given webhook handler path. It is the reverse of WebhookPathFor.
Types ¶
type Handler ¶
type Handler struct { Reader client.Reader Clock clock.PassiveClock }
Handler handles admission requests and invalidates the static token in Secret resources related to ServiceAccounts.
func (*Handler) AddToManager ¶
AddToManager adds Handler to the given manager.
Click to show internal directories.
Click to hide internal directories.