webhooks

package
v1.8.5 Latest Latest
Warning

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

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

Documentation

Overview

Package webhooks contains external webhook implementations for some of our API types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAndValidateVariables added in v1.4.0

func DefaultAndValidateVariables(ctx context.Context, cluster, oldCluster *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList

DefaultAndValidateVariables defaults and validates variables in the Cluster and MachineDeployment/MachinePool topologies based on the definitions in the ClusterClass.

func DefaultVariables added in v1.4.0

func DefaultVariables(cluster *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList

DefaultVariables defaults variables in the Cluster based on information in the ClusterClass.

func SetMinNodeStartupTimeout added in v1.6.0

func SetMinNodeStartupTimeout(d metav1.Duration)

SetMinNodeStartupTimeout allows users to optionally set a custom timeout for the validation webhook.

This function is mostly used within envtest (integration tests), and should never be used in a production environment.

func ValidateClusterForClusterClass added in v1.4.0

func ValidateClusterForClusterClass(cluster *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList

ValidateClusterForClusterClass uses information in the ClusterClass to validate the Cluster.

Types

type Cluster

type Cluster struct {
	Client  client.Reader
	Tracker ClusterCacheTrackerReader
	// contains filtered or unexported fields
}

Cluster implements a validating and defaulting webhook for Cluster.

func (*Cluster) Default

func (webhook *Cluster) Default(ctx context.Context, obj runtime.Object) error

Default satisfies the defaulting webhook interface.

func (*Cluster) SetupWebhookWithManager

func (webhook *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager sets up Cluster webhooks.

func (*Cluster) ValidateCreate

func (webhook *Cluster) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.

func (*Cluster) ValidateDelete

func (webhook *Cluster) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.

func (*Cluster) ValidateUpdate

func (webhook *Cluster) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.

type ClusterCacheTrackerReader added in v1.6.4

type ClusterCacheTrackerReader interface {
	GetReader(ctx context.Context, cluster client.ObjectKey) (client.Reader, error)
}

ClusterCacheTrackerReader is a scoped-down interface from ClusterCacheTracker that only allows to get a reader client.

type ClusterClass

type ClusterClass struct {
	Client client.Reader
}

ClusterClass implements a validation and defaulting webhook for ClusterClass.

func (*ClusterClass) Default

func (webhook *ClusterClass) Default(_ context.Context, obj runtime.Object) error

Default implements defaulting for ClusterClass create and update.

func (*ClusterClass) SetupWebhookWithManager

func (webhook *ClusterClass) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*ClusterClass) ValidateCreate

func (webhook *ClusterClass) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements validation for ClusterClass create.

func (*ClusterClass) ValidateDelete

func (webhook *ClusterClass) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateDelete implements validation for ClusterClass delete.

func (*ClusterClass) ValidateUpdate

func (webhook *ClusterClass) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements validation for ClusterClass update.

type Machine added in v1.6.0

type Machine struct{}

Machine implements a validation and defaulting webhook for Machine.

func (*Machine) Default added in v1.6.0

func (webhook *Machine) Default(_ context.Context, obj runtime.Object) error

Default implements webhook.Defaulter so a webhook will be registered for the type.

func (*Machine) SetupWebhookWithManager added in v1.6.0

func (webhook *Machine) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Machine) ValidateCreate added in v1.6.0

func (webhook *Machine) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.

func (*Machine) ValidateDelete added in v1.6.0

func (webhook *Machine) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.

func (*Machine) ValidateUpdate added in v1.6.0

func (webhook *Machine) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.

type MachineDeployment added in v1.6.0

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

MachineDeployment implements a validation and defaulting webhook for MachineDeployment.

func (*MachineDeployment) Default added in v1.6.0

func (webhook *MachineDeployment) Default(ctx context.Context, obj runtime.Object) error

Default implements webhook.CustomDefaulter.

func (*MachineDeployment) SetupWebhookWithManager added in v1.6.0

func (webhook *MachineDeployment) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*MachineDeployment) ValidateCreate added in v1.6.0

func (webhook *MachineDeployment) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.

func (*MachineDeployment) ValidateDelete added in v1.6.0

func (webhook *MachineDeployment) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type.

func (*MachineDeployment) ValidateUpdate added in v1.6.0

func (webhook *MachineDeployment) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.

type MachineHealthCheck added in v1.6.0

type MachineHealthCheck struct{}

MachineHealthCheck implements a validation and defaulting webhook for MachineHealthCheck.

func (*MachineHealthCheck) Default added in v1.6.0

func (webhook *MachineHealthCheck) Default(_ context.Context, obj runtime.Object) error

Default implements webhook.CustomDefaulter so a webhook will be registered for the type.

func (*MachineHealthCheck) SetupWebhookWithManager added in v1.6.0

func (webhook *MachineHealthCheck) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*MachineHealthCheck) ValidateCreate added in v1.6.0

func (webhook *MachineHealthCheck) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.

func (*MachineHealthCheck) ValidateDelete added in v1.6.0

func (webhook *MachineHealthCheck) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.

func (*MachineHealthCheck) ValidateUpdate added in v1.6.0

func (webhook *MachineHealthCheck) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type.

type MachineSet added in v1.6.0

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

MachineSet implements a validation and defaulting webhook for MachineSet.

func (*MachineSet) Default added in v1.6.0

func (webhook *MachineSet) Default(ctx context.Context, obj runtime.Object) error

Default sets default MachineSet field values.

func (*MachineSet) SetupWebhookWithManager added in v1.6.0

func (webhook *MachineSet) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*MachineSet) ValidateCreate added in v1.6.0

func (webhook *MachineSet) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type.

func (*MachineSet) ValidateDelete added in v1.6.0

func (webhook *MachineSet) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type.

func (*MachineSet) ValidateUpdate added in v1.6.0

func (webhook *MachineSet) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.

Directories

Path Synopsis
Package runtime contains the webhook implementation for runtime ExtensionConfig.
Package runtime contains the webhook implementation for runtime ExtensionConfig.
Package test contains integration tests for webhooks.
Package test contains integration tests for webhooks.
Package util includes the utility functions for testing webhooks.
Package util includes the utility functions for testing webhooks.

Jump to

Keyboard shortcuts

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