Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSecretToken ¶
func GetSecretToken(req *http.Request, cs kubernetes.Interface, sr *triggersv1.SecretRef, eventListenerNamespace string) ([]byte, error)
GetSecretToken queries Kubernetes for the given secret reference. We use this function to resolve secret material like Github webhook secrets, and call it once for every trigger that references it.
As we may have many triggers that all use the same secret, we cache the secret values in the request cache.
func WithCache ¶ added in v0.6.0
WithCache clones the given request and sets the request context to include a cache. This allows us to cache results from expensive operations and perform them just once per each trigger.
Each request should have its own cache, and those caches should expire once the request is processed. For this reason, it's appropriate to store the cache on the request context.