webhook

package
v0.0.0-...-d68cec5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

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

	// WebhookModeService is a constant for the webhook mode indicating that the controller is running inside of the Kubernetes cluster it
	// is serving.
	WebhookModeService = "service"
	// WebhookModeURL is a constant for the webhook mode indicating that the controller is running outside of the Kubernetes cluster it
	// is serving. If this is set then a URL is required for configuration.
	WebhookModeURL = "url"
)

Variables

This section is empty.

Functions

func GenerateCertificates

func GenerateCertificates(certDir, namespace, name, mode, url string) ([]byte, error)

GenerateCertificates generates the certificates that are required for a webhook. It returns the ca bundle, and it stores the server certificate and key locally on the file system.

func RegisterWebhooks

func RegisterWebhooks(ctx context.Context, mgr manager.Manager, namespace, providerName string, port int, mode, url string, caBundle []byte, webhooks []*Webhook) error

Registers the given webhooks in the Kubernetes cluster targeted by the provided manager.

Types

type FactoryAggregator

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

FactoryAggregator aggregates various Factory functions.

func NewFactoryAggregator

func NewFactoryAggregator(m []func(manager.Manager) (*Webhook, error)) FactoryAggregator

NewFactoryAggregator creates a new FactoryAggregator and registers the given functions.

func (*FactoryAggregator) Register

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

Register registers the given functions in this builder.

func (*FactoryAggregator) Webhooks

func (a *FactoryAggregator) Webhooks(mgr manager.Manager) ([]*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 Webhook

type Webhook struct {
	Name     string
	Kind     string
	Provider string
	Path     string
	Types    []runtime.Object
	Webhook  *admission.Webhook
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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