webhook

package
v0.0.0-...-27a81c3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdmissionResponder

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

AdmissionResponder is a helper for handling admission response creation It supports adding and returning multiple errors to the user

func (*AdmissionResponder) Flush

Flush creates the admission response to return

func (*AdmissionResponder) HasErrors

func (a *AdmissionResponder) HasErrors() bool

HasErrors returns a true if there are errors false if not

func (*AdmissionResponder) IsAllowed

func (a *AdmissionResponder) IsAllowed() bool

IsAllowed returns a true if the admission is allowed false if not

func (*AdmissionResponder) SetAllowed

func (a *AdmissionResponder) SetAllowed()

SetAllowed sets the admission response to allow the admission

func (*AdmissionResponder) SetPatch

func (a *AdmissionResponder) SetPatch(patch []byte)

SetPatch sets the patches to be applied by the api server

func (*AdmissionResponder) StringToAdmissionResponse

func (a *AdmissionResponder) StringToAdmissionResponse(msg string)

StringToAdmissionResponse adds a string as an error to the response

func (*AdmissionResponder) ToAdmissionResponse

func (a *AdmissionResponder) ToAdmissionResponse(err error)

ToAdmissionResponse adds an error to the response

func (*AdmissionResponder) Write

Write writes the output of flush to the passed responsewriter

type Server

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

Server is the admission webhook server

func NewServer

func NewServer(name string, ctrl controller.Interface, cert, key []byte) *Server

NewServer creates a new admission webhook server with the passed controller handling the admissions

func (*Server) HandleAdmissionRequest

func (s *Server) HandleAdmissionRequest(w http.ResponseWriter, r *http.Request)

HandleAdmissionRequest handles an incoming request and calls the controllers admit function It writes the response from the Admit to the response writer

func (*Server) Run

func (s *Server) Run()

Run starts the server

Jump to

Keyboard shortcuts

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