Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdmissionController ¶
type AdmissionController interface {
HandleAdmission(*admissionv1.AdmissionReview)
}
AdmissionController checks if an object is allowed in the cluster
type AdmissionControllerServer ¶
type AdmissionControllerServer struct { AdmissionController AdmissionController Decoder runtime.Decoder }
AdmissionControllerServer implements an HTTP server for kubernetes validating webhook https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#validatingadmissionwebhook
func NewAdmissionControllerServer ¶
func NewAdmissionControllerServer(ac AdmissionController) *AdmissionControllerServer
NewAdmissionControllerServer instanciates an admission controller server with a default codec
func (*AdmissionControllerServer) ServeHTTP ¶
func (acs *AdmissionControllerServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Server method
type Checker ¶
type Checker interface {
CheckIngress(ing *networking.Ingress) error
}
Checker must return an error if the ingress provided as argument contains invalid instructions
type IngressAdmission ¶
type IngressAdmission struct {
Checker Checker
}
IngressAdmission implements the AdmissionController interface to handle Admission Reviews and deny requests that are not validated
func (*IngressAdmission) HandleAdmission ¶
func (ia *IngressAdmission) HandleAdmission(ar *admissionv1.AdmissionReview)
HandleAdmission populates the admission Response with Allowed=false if the Object is an ingress that would prevent nginx to reload the configuration with Allowed=true otherwise