...

Package webhook

import "github.com/linkerd/linkerd2/controller/webhook"
Overview
Index

Overview ▾

func GetProxyContainerPath

func GetProxyContainerPath(spec corev1.PodSpec) string

GetProxyContainerPath gets the proxy container jsonpath of a pod relative to spec; this path is required in webhooks because of how patches are created.

func Launch

func Launch(
    ctx context.Context,
    apiresources []k8s.APIResource,
    handler Handler,
    component,
    metricsAddr string,
    addr string,
    kubeconfig string,
    enablePprof bool,
)

Launch sets up and starts the webhook and metrics servers

type Handler

Handler is the signature for the functions that ultimately deal with the admission request

type Handler func(
    context.Context,
    *k8s.MetadataAPI,
    *admissionv1beta1.AdmissionRequest,
    record.EventRecorder,
) (*admissionv1beta1.AdmissionResponse, error)

type Server

Server describes the https server implementing the webhook

type Server struct {
    *http.Server
    // contains filtered or unexported fields
}

func NewServer

func NewServer(
    ctx context.Context,
    api *pkgk8s.KubernetesAPI,
    metadataAPI *k8s.MetadataAPI,
    addr, certPath string,
    handler Handler,
    component string,
) (*Server, error)

NewServer returns a new instance of Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown initiates a graceful shutdown of the underlying HTTP server.

func (*Server) Start

func (s *Server) Start()

Start starts the https server