webhook

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModeService is a constant for the webhook mode indicating that the controller is running inside of the Kubernetes cluster it
	// is serving.
	ModeService = "service"
	// ModeURL 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.
	ModeURL = "url"
	// ModeURLWithServiceName is a constant for the webhook mode indicating that the controller is running outside of the Kubernetes cluster it
	// is serving but in the same cluster like the kube-apiserver. If this is set then a URL is required for configuration.
	ModeURLWithServiceName = "url-service"
)
View Source
const WebhookPath = "/webhook"

WebhookPath is the path under which the webhook will be registered.

Variables

This section is empty.

Functions

func GenerateCertificates added in v0.9.0

func GenerateCertificates(ctx context.Context, mgr manager.Manager, 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.

Types

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

Webhook is the implementation for all the webhooks required for kupid.

func NewDefaultWebhook

func NewDefaultWebhook() (*Webhook, error)

NewDefaultWebhook creates a Webhook instance with the default eet of processor factories registered.

func NewWebhook

func NewWebhook() *Webhook

NewWebhook creates a bare Webhook instance.

func NewWebhookWithProcessorFactories

func NewWebhookWithProcessorFactories(pfs []processorFactory) (*Webhook, error)

NewWebhookWithProcessorFactories creates a Webhook instance with the supplied processor factories registered.

func (*Webhook) Handle

Handle handles admission requests.

func (*Webhook) InjectAPIReader added in v0.1.2

func (w *Webhook) InjectAPIReader(r client.Reader) error

InjectAPIReader injects a direct client.Reader into the webhook.

func (*Webhook) InjectCache

func (w *Webhook) InjectCache(c cache.Cache) error

InjectCache injects a cache into the webhook.

func (*Webhook) InjectDecoder

func (w *Webhook) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a webhook.

func (*Webhook) SetupWithManager

func (w *Webhook) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the webhook to inject applicable podschedulingpolicies and clusterpodschedulingpolicies.

func (*Webhook) Start

func (w *Webhook) Start(ctx context.Context) error

Start initializes the cache. The component will stop running when the channel is closed. Start blocks until the channel is closed or an error occurs.

Jump to

Keyboard shortcuts

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