Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdmissionHook ¶
type AdmissionHook struct { ValuesMapName string // Source of templating values ValuesMapNamespace string // Namespace the configmap lives in RequiredAnnotation string // Annotation required before templating IgnoredPaths []string // Paths to not patch // contains filtered or unexported fields }
AdmissionHook implements the OpenShift MutatingAdmissionHook interface. https://github.com/openshift/generic-admission-server/blob/v1.9.0/pkg/apiserver/apiserver.go#L45
func (*AdmissionHook) Admit ¶
func (ah *AdmissionHook) Admit(req *admissionv1beta1.AdmissionRequest) *admissionv1beta1.AdmissionResponse
Admit is the actual business logic of the webhook. This is the method that processes the request to the admission controller.
Checks the operation is a create or update operation. Loads the template values from the configmap. Templates the values into the raw object (json) from the admission request. Calculates a JSON Patch to append to the admission response.
func (*AdmissionHook) Initialize ¶
func (ah *AdmissionHook) Initialize(kubeClientConfig *restclient.Config, stopCh <-chan struct{}) error
Initialize configures the AdmissionHook.
Initializes connection Kubernetes Client
func (*AdmissionHook) MutatingResource ¶
func (ah *AdmissionHook) MutatingResource() (schema.GroupVersionResource, string)
MutatingResource defines where the Webhook is hosted.