Documentation

Overview

Package request creates admissionReview request based on admission attributes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAdmissionObjects

func CreateAdmissionObjects(versionedAttributes *generic.VersionedAttributes, invocation *generic.WebhookInvocation) (uid types.UID, request, response runtime.Object, err error)

CreateAdmissionObjects returns the unique request uid, the AdmissionReview object to send the webhook and to decode the response into, or an error if the webhook does not support receiving any of the admission review versions we know to send

func CreateV1AdmissionReview

func CreateV1AdmissionReview(uid types.UID, versionedAttributes *generic.VersionedAttributes, invocation *generic.WebhookInvocation) *admissionv1.AdmissionReview

CreateV1AdmissionReview creates an AdmissionReview for the provided admission.Attributes

func CreateV1beta1AdmissionReview

func CreateV1beta1AdmissionReview(uid types.UID, versionedAttributes *generic.VersionedAttributes, invocation *generic.WebhookInvocation) *admissionv1beta1.AdmissionReview

CreateV1beta1AdmissionReview creates an AdmissionReview for the provided admission.Attributes

Types

type AdmissionResponse

type AdmissionResponse struct {
	AuditAnnotations map[string]string
	Allowed          bool
	Patch            []byte
	PatchType        admissionv1.PatchType
	Result           *metav1.Status
	Warnings         []string
}

AdmissionResponse contains the fields extracted from an AdmissionReview response

func VerifyAdmissionResponse

func VerifyAdmissionResponse(uid types.UID, mutating bool, review runtime.Object) (*AdmissionResponse, error)

VerifyAdmissionResponse checks the validity of the provided admission review object, and returns the audit annotations, whether the response allowed the request, any provided patch/patchType/status, or an error if the provided admission review was not valid.