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 { AnnotationDomain string MountPath string Region string Cache cache.ServiceAccountCache ContainerCredentialsConfig containercredentials.Config // 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 WithAnnotationDomain ¶ added in v0.3.0
func WithAnnotationDomain(domain string) ModifierOpt
WithAnnotationDomain adds an annotation domain
func WithContainerCredentialsConfig ¶ added in v0.5.0
func WithContainerCredentialsConfig(config containercredentials.Config) ModifierOpt
WithContainerCredentialsConfig sets the modifier ContainerCredentialsConfig
func WithMountPath ¶
func WithMountPath(mountpath string) ModifierOpt
WithMountPath sets the modifier mountPath
func WithRegion ¶ added in v0.3.0
func WithRegion(region string) ModifierOpt
WithRegion sets the modifier region
func WithServiceAccountCache ¶
func WithServiceAccountCache(c cache.ServiceAccountCache) ModifierOpt
WithServiceAccountCache sets the modifiers cache