Documentation ¶
Index ¶
Constants ¶
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 ¶
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.
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.