controller

package
v0.0.0-...-0db023b Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

Jump to

Keyboard shortcuts

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