server

package
v0.1.1-0...-7f10ddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusInjected is the annotation value for /status that indicates an injection was already performed on this pod
	StatusInjected = "injected"
)

Variables

View Source
var (
	// ErrSkipIgnoredNamespace ...
	ErrSkipIgnoredNamespace = fmt.Errorf("Skipping pod in ignored namespace")
	// ErrSkipAlreadyInjected ...
	ErrSkipAlreadyInjected = fmt.Errorf("Skipping pod that has already been injected")
	// ErrMissingRequestAnnotation ...
	ErrMissingRequestAnnotation = fmt.Errorf("Missing injection request annotation")
	// ErrRequestedSidecarNotFound ...
	ErrRequestedSidecarNotFound = fmt.Errorf("Requested sidecar not found in configuration")
)

Functions

func GetErrorReason

func GetErrorReason(err error) string

GetErrorReason returns a string description for a given error, for use when reporting "reason" in metrics

Types

type Parameters

type Parameters struct {
	LifecyclePort       int    // metrics, debugging, health checking port (just http)
	TLSPort             int    // webhook server port (forced TLS)
	CertFile            string // path to the x509 certificate for https
	KeyFile             string // path to the x509 private key matching `CertFile`
	ConfigDirectory     string // path to sidecar injector configuration directory (contains yamls)
	AnnotationNamespace string // namespace used to scope annotations
}

Parameters parameters

type WebhookServer

type WebhookServer struct {
	Config *config.Config
	Server *http.Server
}

WebhookServer is a server that handles mutating admission webhooks

func (*WebhookServer) HealthHandler

func (whsvr *WebhookServer) HealthHandler() http.Handler

HealthHandler returns ok

func (*WebhookServer) MetricsHandler

func (whsvr *WebhookServer) MetricsHandler() http.Handler

MetricsHandler method for webhook server

func (*WebhookServer) MutateHandler

func (whsvr *WebhookServer) MutateHandler() http.Handler

MutateHandler method for webhook server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL