builder

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL