admission

package
v1.0.1-0...-51f927f Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonContentType = `application/json`
)

Variables

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

Functions

func AdmitFuncHandler

func AdmitFuncHandler(admit AdmitFunc) http.Handler

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

func GetNodeLocations

func GetNodeLocations(ctx context.Context) ([]string, error)

Retrieves regions and zones of all nodes and returns locations as strings without differentiating between zone and region.

Types

type AdmitFunc

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