Documentation ¶
Index ¶
- type WebhookBuilder
- func (b *WebhookBuilder) Build() (*admission.Webhook, error)
- func (b *WebhookBuilder) FailurePolicy(policy admissionregistrationv1beta1.FailurePolicyType) *WebhookBuilder
- func (b *WebhookBuilder) ForType(obj runtime.Object) *WebhookBuilder
- func (b *WebhookBuilder) Handlers(handlers ...admission.Handler) *WebhookBuilder
- func (b *WebhookBuilder) Mutating() *WebhookBuilder
- func (b *WebhookBuilder) Name(name string) *WebhookBuilder
- func (b *WebhookBuilder) NamespaceSelector(namespaceSelector *metav1.LabelSelector) *WebhookBuilder
- func (b *WebhookBuilder) Operations(ops ...admissionregistrationv1beta1.OperationType) *WebhookBuilder
- func (b *WebhookBuilder) Path(path string) *WebhookBuilder
- func (b *WebhookBuilder) Rules(rules ...admissionregistrationv1beta1.RuleWithOperations) *WebhookBuilder
- func (b *WebhookBuilder) Validating() *WebhookBuilder
- func (b *WebhookBuilder) WithManager(mgr manager.Manager) *WebhookBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebhookBuilder ¶
type WebhookBuilder struct {
// contains filtered or unexported fields
}
WebhookBuilder builds a webhook based on the provided options.
func NewWebhookBuilder ¶
func NewWebhookBuilder() *WebhookBuilder
NewWebhookBuilder creates an empty WebhookBuilder.
func (*WebhookBuilder) Build ¶
func (b *WebhookBuilder) Build() (*admission.Webhook, error)
Build creates the Webhook based on the options provided.
func (*WebhookBuilder) FailurePolicy ¶
func (b *WebhookBuilder) FailurePolicy(policy admissionregistrationv1beta1.FailurePolicyType) *WebhookBuilder
FailurePolicy sets the FailurePolicy of the webhook. If not set, it will be defaulted by the server. This is optional
func (*WebhookBuilder) ForType ¶
func (b *WebhookBuilder) ForType(obj runtime.Object) *WebhookBuilder
ForType sets the type of resources that the webhook will operate. It will be overridden by Rules if Rules are not empty.
func (*WebhookBuilder) Handlers ¶
func (b *WebhookBuilder) Handlers(handlers ...admission.Handler) *WebhookBuilder
Handlers sets the handlers of the webhook.
func (*WebhookBuilder) Mutating ¶
func (b *WebhookBuilder) Mutating() *WebhookBuilder
Mutating sets the type to mutating admission webhook Only one of Mutating and Validating can be invoked.
func (*WebhookBuilder) Name ¶
func (b *WebhookBuilder) Name(name string) *WebhookBuilder
Name sets the name of the webhook. This is optional
func (*WebhookBuilder) NamespaceSelector ¶
func (b *WebhookBuilder) NamespaceSelector(namespaceSelector *metav1.LabelSelector) *WebhookBuilder
NamespaceSelector sets the NamespaceSelector for the webhook. This is optional
func (*WebhookBuilder) Operations ¶
func (b *WebhookBuilder) Operations(ops ...admissionregistrationv1beta1.OperationType) *WebhookBuilder
Operations sets the operations that this webhook cares. It will be overridden by Rules if Rules are not empty. This is optional
func (*WebhookBuilder) Path ¶
func (b *WebhookBuilder) Path(path string) *WebhookBuilder
Path sets the path for the webhook. Path needs to be unique among different webhooks. This is optional. If not set, it will be built from the type and resource name. For example, a webhook that mutates pods has a default path of "/mutate-pods" If the defaulting logic can't find a unique path for it, user need to set it manually.
func (*WebhookBuilder) Rules ¶
func (b *WebhookBuilder) Rules(rules ...admissionregistrationv1beta1.RuleWithOperations) *WebhookBuilder
Rules sets the RuleWithOperations for the webhook. It overrides ForType and Operations. This is optional and for advanced user.
func (*WebhookBuilder) Validating ¶
func (b *WebhookBuilder) Validating() *WebhookBuilder
Validating sets the type to validating admission webhook Only one of Mutating and Validating can be invoked.
func (*WebhookBuilder) WithManager ¶
func (b *WebhookBuilder) WithManager(mgr manager.Manager) *WebhookBuilder
WithManager set the manager for the webhook for provisioning various dependencies. e.g. client etc.