webhooks

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2018 License: Apache-2.0 Imports: 7 Imported by: 25

Documentation

Overview

Package webhooks manages and receives Kubernetes Webhooks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(review v1beta1.AdmissionReview) (v1beta1.AdmissionReview, error)

Handler handles a webhook's AdmissionReview coming in, and will return the AdmissionReview that will be the return value of the webhook

type Server

type Server interface {
	Close() error
	ListenAndServeTLS(certFile, keyFile string) error
}

Server is a http server interface to enable easier testing

type WebHook

type WebHook struct {
	// contains filtered or unexported fields
}

WebHook manage Kubernetes webhooks

func NewWebHook

func NewWebHook(certFile, keyFile string) *WebHook

NewWebHook returns a Kubernetes webhook manager

func (*WebHook) AddHandler

func (wh *WebHook) AddHandler(path string, gk schema.GroupKind, op v1beta1.Operation, h Handler)

AddHandler adds a handler for a given path, group and kind, and operation

func (*WebHook) Run

func (wh *WebHook) Run(workers int, stop <-chan struct{}) error

Run runs the webhook server, starting a https listener. Will block on stop channel

Source Files

Jump to

Keyboard shortcuts

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