Documentation ¶
Overview ¶
Package handler implements the http.HandlerFunc for mutating pod requests
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Middleware ¶
Middleware is a type for decorating requests.
func InstrumentRoute ¶
func InstrumentRoute() Middleware
InstrumentRoute is a middleware for adding the following metrics for each route:
# Counter http_request_count{"verb", "path", "code} # Histogram http_request_latencies{"verb", "path"} # Summary http_request_duration_microseconds{"verb", "path", "code}
func Logging ¶
func Logging() Middleware
type Modifier ¶
type Modifier struct { Expiration int64 MountPath string Cache cache.ServiceAccountCache // contains filtered or unexported fields }
Modifier holds configuration values for pod modifications
func NewModifier ¶
func NewModifier(opts ...ModifierOpt) *Modifier
NewModifier returns a Modifier with default values
func (*Modifier) Handle ¶
func (m *Modifier) Handle(w http.ResponseWriter, r *http.Request)
Handle handles pod modification requests
func (*Modifier) MutatePod ¶
func (m *Modifier) MutatePod(ar *v1beta1.AdmissionReview) *v1beta1.AdmissionResponse
MutatePod takes a AdmissionReview, mutates the pod, and returns an AdmissionResponse
type ModifierOpt ¶
type ModifierOpt func(*Modifier)
ModifierOpt is an option type for setting up a Modifier
func WithExpiration ¶
func WithExpiration(exp int64) ModifierOpt
WithExpiration sets the modifier expiration
func WithMountPath ¶
func WithMountPath(mountpath string) ModifierOpt
WithMountPath sets the modifier mountPath
func WithServiceAccountCache ¶
func WithServiceAccountCache(c cache.ServiceAccountCache) ModifierOpt
WithServiceAccountCache sets the modifiers cache
Click to show internal directories.
Click to hide internal directories.