admit

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

*

  • Admission mutation handler utility.

Index

Constants

View Source
const (
	ENV_BASE_PATH = "BASE_PATH"
)

Query base path

Variables

View Source
var (
	UniversalDeserializer = serializer.NewCodecFactory(runtime.NewScheme()).UniversalDeserializer()
)

Functions

func AdmitFuncHandler

func AdmitFuncHandler(adm AdmitFunc) http.Handler

admitFuncHandler takes an admitFunc and wraps it into a http.Handler by means of calling serveAdmitFunc.

func GetBasePath

func GetBasePath() string

Get server base path

Types

type AdmitFunc

type AdmitFunc func(*v1beta1.AdmissionRequest) ([]PatchOperation, error)

admitFunc is a callback for admission controller logic. Given an AdmissionRequest, it returns the sequence of patch operations to be applied in case of success, or the error that will be shown when the operation is rejected.

type PatchOperation

type PatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}

patchOperation is an operation of a JSON patch, see https://tools.ietf.org/html/rfc6902 .

Jump to

Keyboard shortcuts

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