webhook

package
v0.0.0-...-97dd610 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetCertificate

type GetCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)

type PodPatch

type PodPatch func(*v1.Pod) (*v1.Pod, error)

type Webhook

type Webhook struct {
	Patches    []PodPatch
	AllowOnErr bool

	Server *http.Server
	// contains filtered or unexported fields
}

func NewWebhook

func NewWebhook(certificate GetCertificate) *Webhook

func (*Webhook) Admit

func (*Webhook) Init

func (wh *Webhook) Init(options *config.Options)

func (*Webhook) Mutate

func (wh *Webhook) Mutate(w http.ResponseWriter, r *http.Request)

func (*Webhook) NewServer

func (wh *Webhook) NewServer(port int32) *http.Server

func (*Webhook) PatchPod

func (wh *Webhook) PatchPod(pod *v1.Pod) ([]byte, error)

func (*Webhook) Serve

func (wh *Webhook) Serve()

func (*Webhook) ServeHealth

func (wh *Webhook) ServeHealth(w http.ResponseWriter, r *http.Request)

ServeHealth returns 200 when things are good

func (*Webhook) Stop

func (wh *Webhook) Stop()

Jump to

Keyboard shortcuts

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