admission

package
v0.0.1-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Handler RequestHandler
}

Handler Generic handler for Admission

func (*Handler) HandleAdmission

func (handler *Handler) HandleAdmission(writer http.ResponseWriter, request *http.Request)

HandleAdmission HttpServer function to handle Admissions

func (*Handler) Process

func (handler *Handler) Process(ctx context.Context, request *admissionv1.AdmissionRequest) ([]PatchOperation, error)

Process Handles the AdmissionRequest via the handler

type PatchOperation

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

PatchOperation JsonPatch struct http://jsonpatch.com/

type PodAdmissionRequestHandler

type PodAdmissionRequestHandler struct {
	PodHandler PodPatcher
}

PodAdmissionRequestHandler PodAdmissionRequest handler

type PodPatcher

type PodPatcher interface {
	PatchPodCreate(ctx context.Context, namespace string, pod corev1.Pod) ([]PatchOperation, error)
	PatchPodUpdate(ctx context.Context, namespace string, oldPod corev1.Pod, newPod corev1.Pod) ([]PatchOperation, error)
	PatchPodDelete(ctx context.Context, namespace string, pod corev1.Pod) ([]PatchOperation, error)
}

PodPatcher Pod patching interface

type RequestHandler

type RequestHandler interface {
	// contains filtered or unexported methods
}

RequestHandler AdmissionRequest handler

Jump to

Keyboard shortcuts

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