webhook

package
v0.0.0-...-6c6f41e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NameSuffix is a common suffix for all webhook names.
	NameSuffix = "extensions.gardener.cloud"

	// SeedProviderLabel is a label on shoot namespaces in the seed cluster that identifies the Seed provider.
	// TODO Move this constant to gardener/gardener
	SeedProviderLabel = "seed.gardener.cloud/provider"
	// ShootProviderLabel is a label on shoot namespaces in the seed cluster that identifies the Shoot provider.
	// TODO Move this constant to gardener/gardener
	ShootProviderLabel = "shoot.gardener.cloud/provider"
	// BackupProviderLabel is a label on shoot namespaces in the seed cluster that identifies the Backup provider.
	// This provider can be different from both the Seed or the Shoot provider, see https://github.com/gardener/gardener/blob/master/docs/proposals/02-backupinfra.md.
	// TODO Move this constant to gardener/gardener
	BackupProviderLabel = "backup.gardener.cloud/provider"
)

Variables

This section is empty.

Functions

func NewWebhook

func NewWebhook(mgr manager.Manager, kind Kind, provider, name string, types []runtime.Object, handler admission.Handler) (*admission.Webhook, error)

NewWebhook creates a new mutating webhook for create and update operations with the given kind, provider, and name, applicable to objects of all given types, executing the given handler, and bound to the given manager.

Types

type FactoryAggregator

type FactoryAggregator []func(manager.Manager) (webhook.Webhook, error)

FactoryAggregator aggregates various Factory functions.

func NewFactoryAggregator

func NewFactoryAggregator(funcs ...func(manager.Manager) (webhook.Webhook, error)) FactoryAggregator

NewFactoryAggregator creates a new FactoryAggregator and registers the given functions.

func (*FactoryAggregator) Register

func (a *FactoryAggregator) Register(funcs ...func(manager.Manager) (webhook.Webhook, error))

Register registers the given functions in this builder.

func (*FactoryAggregator) Webhooks

func (a *FactoryAggregator) Webhooks(mgr manager.Manager) ([]webhook.Webhook, error)

Webhooks calls all factories with the given managers and returns all created webhooks. As soon as there is an error creating a webhook, the error is returned immediately.

type Kind

type Kind string

Kind is a type for webhook kinds.

const (
	// A seed webhook is applied only to those shoot namespaces that have the correct Seed provider label.
	SeedKind Kind = "seed"
	// A shoot webhook is applied only to those shoot namespaces that have the correct Shoot provider label.
	ShootKind Kind = "shoot"
	// A backup webhook is applied only to those shoot namespaces that have the correct Backup provider label.
	BackupKind Kind = "backup"
)

Webhook kinds.

type ServerBuilder

type ServerBuilder struct {
	Name     string
	Options  webhook.ServerOptions
	Webhooks []webhook.Webhook
}

ServerBuilder is a builder to build a webhook server.

func NewServerBuilder

func NewServerBuilder(name string, options webhook.ServerOptions, webhooks ...webhook.Webhook) *ServerBuilder

NewServerBuilder instantiates a new ServerBuilder with the given name, options and initial set of webhooks.

func (*ServerBuilder) AddToManager

func (s *ServerBuilder) AddToManager(mgr manager.Manager) error

AddToManager creates and adds the webhook server to the manager if there are any webhooks. If there are no webhooks, this is a no-op.

func (*ServerBuilder) Register

func (s *ServerBuilder) Register(webhooks ...webhook.Webhook)

Register registers the given Webhooks in this ServerBuilder.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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