Documentation ¶
Overview ¶
Package webhook contains libraries for generating webhookconfig manifests from markers in Go source files.
The markers take the form:
+kubebuilder:webhook:failurePolicy=<string>,groups=<[]string>,resources=<[]string>,verbs=<[]string>,versions=<[]string>,name=<string>,path=<string>,mutating=<bool>
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ConfigDefinition s a marker for defining Webhook manifests. // Call ToWebhook on the value to get a Kubernetes Webhook. ConfigDefinition = markers.Must(markers.MakeDefinition("kubebuilder:webhook", markers.DescribesPackage, Config{})) )
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.2.0
type Config struct { // Mutating marks this as a mutating webhook (it's validating only if false) // // Mutating webhooks are allowed to change the object in their response, // and are called *before* all validating webhooks. Mutating webhooks may // choose to reject an object, similarly to a validating webhook. Mutating bool // FailurePolicy specifies what should happen if the API server cannot reach the webhook. // // It may be either "ignore" (to skip the webhook and continue on) or "fail" (to reject // the object in question). FailurePolicy string // Groups specifies the API groups that this webhook receives requests for. Groups []string // Resources specifies the API resources that this webhook receives requests for. Resources []string // Verbs specifies the Kubernetes API verbs that this webhook receives requests for. // // Only modification-like verbs may be specified. // May be "create", "update", "delete", "connect", or "*" (for all). Verbs []string // Versions specifies the API versions that this webhook receives requests for. Versions []string // Name indicates the name of this webhook configuration. Name string // Path specifies that path that the API server should connect to this webhook on. Path string }
Config specifies how a webhook should be served.
It specifies only the details that are intrinsic to the application serving it (e.g. the resources it can handle, or the path it serves on).
func (Config) Help ¶ added in v0.2.0
func (Config) Help() *markers.DefinitionHelp
func (Config) ToMutatingWebhook ¶ added in v0.2.2
func (c Config) ToMutatingWebhook() (admissionreg.MutatingWebhook, error)
ToMutatingWebhook converts this rule to its Kubernetes API form.
func (Config) ToValidatingWebhook ¶ added in v0.2.2
func (c Config) ToValidatingWebhook() (admissionreg.ValidatingWebhook, error)
ToValidatingWebhook converts this rule to its Kubernetes API form.
type Generator ¶ added in v0.2.0
type Generator struct{}
Generator generates (partial) {Mutating,Validating}WebhookConfiguration objects.
func (Generator) Generate ¶ added in v0.2.0
func (Generator) Generate(ctx *genall.GenerationContext) error
func (Generator) Help ¶ added in v0.2.0
func (Generator) Help() *markers.DefinitionHelp
Click to show internal directories.
Click to hide internal directories.