Documentation ¶
Index ¶
- type AdmissionResponder
- func (a *AdmissionResponder) Flush() *v1.AdmissionResponse
- func (a *AdmissionResponder) HasErrors() bool
- func (a *AdmissionResponder) IsAllowed() bool
- func (a *AdmissionResponder) MapStringsToAdmissionResponse(mapofmsgs map[string][]string)
- func (a *AdmissionResponder) SetAllowed()
- func (a *AdmissionResponder) SetPatch(patch []byte)
- func (a *AdmissionResponder) StringToAdmissionResponse(msg string)
- func (a *AdmissionResponder) StringsToAdmissionResponse(msgs []string)
- func (a *AdmissionResponder) ToAdmissionResponse(err error)
- func (a *AdmissionResponder) Write(w http.ResponseWriter, ar v1.AdmissionReview)
- type Server
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 ¶
func (a *AdmissionResponder) Flush() *v1.AdmissionResponse
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) MapStringsToAdmissionResponse ¶
func (a *AdmissionResponder) MapStringsToAdmissionResponse(mapofmsgs map[string][]string)
MapStringsToAdmissionResponse adds a map of a slice of strings as errors to the reponse
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) StringsToAdmissionResponse ¶
func (a *AdmissionResponder) StringsToAdmissionResponse(msgs []string)
StringsToAdmissionResponse adds a slice of strings as errors to the response
func (*AdmissionResponder) ToAdmissionResponse ¶
func (a *AdmissionResponder) ToAdmissionResponse(err error)
ToAdmissionResponse adds an error to the response
func (*AdmissionResponder) Write ¶
func (a *AdmissionResponder) Write(w http.ResponseWriter, ar v1.AdmissionReview)
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) HandleLiveness ¶
func (s *Server) HandleLiveness(w http.ResponseWriter, r *http.Request)
HandleLiveness responds to a Kubernetes Liveness probe Fail this request if Kubernetes should restart this instance
func (*Server) HandleReadiness ¶
func (s *Server) HandleReadiness(w http.ResponseWriter, r *http.Request)
HandleReadiness responds to a Kubernetes Readiness probe Fail this request if this instance can't accept traffic, but Kubernetes shouldn't restart it