Documentation
¶
Index ¶
Constants ¶
View Source
const InvalidAdmissionReviewMsg = "invalid k8s admission review"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdmissionRequest ¶
type AdmissionRequest interface {
// Kind returns the metav1.GroupVersionKind of the request object
Kind() metav1.GroupVersionKind
// Object returns the runtime.RawExtension representing the request object
Object() *runtime.RawExtension
// Object returns the runtime.RawExtension representing the request old object
OldObject() *runtime.RawExtension
// Resource returns the metav1.GroupVersionResource for the request object
Resource() metav1.GroupVersionResource
// Namespace returns the name of the namespace which is source to this request
Namespace() string
}
AdmissionRequest facades the AdmissionReview request
type AdmissionResponse ¶
type AdmissionResponse interface {
// Allow allows the review
Allow()
// Deny denies the review using the provided status
Deny(status *metav1.Status)
// PatchJSON will apply a json patch to the response
PatchJSON(bytes []byte)
// ResponseType returns the ResponseType for statistics
ResponseType() ResponseType
}
AdmissionResponse facades the AdmissionReview response
type AdmissionReview ¶
type AdmissionReview interface {
// Request returns the request
Request() AdmissionRequest
// Response returns the response
Response() AdmissionResponse
// Version returns the version string of the admission review itself
Version() string
// Marshal marshals the object again
Marshal() ([]byte, error)
}
AdmissionReview is a facade for the admission review (to deal with the type-safety of different versions)
func AdmissionReviewFrom ¶
func AdmissionReviewFrom(bytes []byte) (AdmissionReview, error)
AdmissionReviewFrom tries to unmarshal an admission review form the provided bytes and create a decorator for it
func V1Beta1 ¶
func V1Beta1(target *v1beta1.AdmissionReview) AdmissionReview
V1Beta1 creates an admission review for v1beta1
type ResponseType ¶
type ResponseType string
const ( AdmissionAllowed ResponseType = "allowed" AdmissionDenied ResponseType = "denied" AdmissionMutated ResponseType = "mutated" AdmissionError ResponseType = "error" AdmissionClientError ResponseType = "client_error" )
Click to show internal directories.
Click to hide internal directories.