Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResourceHandler ¶
type ResourceHandler interface { OnCreate(obj runtime.Object) (runtime.Object, error) OnUpdate(oldObj, newObj runtime.Object) (runtime.Object, error) OnDelete(obj runtime.Object) error }
ResourceHandler can handle admission requests that happen to a resource.
- OnCreate is called when an object is created. If an error is returned admission is denied. Otherwise, if an object is returned, it is used to compute a patch and should be used as MutatingAdmissionWebhook.
- OnUpdate is called when an object is updated. Note that oldObj is the existing object. If an error is returned admission is denied. Otherwise, if an object is returned, it is used to compute a patch and should be used as MutatingAdmissionWebhook.
- OnDelete will gets the current state of object when delete request is received.
type ResourceHandlerFuncs ¶
type ResourceHandlerFuncs struct { CreateFunc func(obj runtime.Object) (runtime.Object, error) UpdateFunc func(oldObj, newObj runtime.Object) (runtime.Object, error) DeleteFunc func(obj runtime.Object) error }
ResourceHandlerFuncs is an adaptor to let you easily specify as many or as few of the notification functions as you want while still implementing ResourceHandler.
Click to show internal directories.
Click to hide internal directories.