Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWebhook ¶
func NewWebhook(cfg WebhookConfig, mutator Mutator, recorder metrics.Recorder, logger log.Logger) (webhook.Webhook, error)
NewWebhook is a mutating webhook and will return a webhook ready for a type of resource. It will mutate the received resources. This webhook will always allow the admission of the resource, only will deny in case of error.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain is a chain of mutators that will execute secuentially all the mutators that have been added to it. It satisfies Mutator interface.
type Mutator ¶
type Mutator interface { // Mutate will received a pointr to an object that can be mutated // mutators are grouped in chains so the mutate method can return // a stop boolean to stop executing the chain and also an error. Mutate(context.Context, metav1.Object) (stop bool, err error) }
Mutator knows how to mutate the received kubernetes object.
Example (PodAnnotateMutatingWebhook) ¶
PodAnnotateMutatingWebhook shows how you would create a pod mutating webhook that adds annotations to every pod received.
Output:
type MutatorFunc ¶
MutatorFunc is a helper type to create mutators from functions.
type WebhookConfig ¶
WebhookConfig is the Mutating webhook configuration.