controller

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 10 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(runtime.Object) (runtime.Object, error)
}

AdmissionController checks if an object is allowed in the cluster

type AdmissionControllerServer

type AdmissionControllerServer struct {
	AdmissionController AdmissionController
}

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, req *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(obj runtime.Object) (runtime.Object, error)

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