Documentation ¶
Overview ¶
Package webhooks contains external webhook implementations for some of our API types.
Index ¶
- func DefaultAndValidateVariables(ctx context.Context, cluster, oldCluster *clusterv1.Cluster, ...) field.ErrorList
- func DefaultVariables(cluster *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList
- func SetMinNodeStartupTimeout(d metav1.Duration)
- func ValidateClusterForClusterClass(cluster *clusterv1.Cluster, clusterClass *clusterv1.ClusterClass) field.ErrorList
- func ValidateMachineDrainRulesSelectors(machineDrainRule *clusterv1.MachineDrainRule) field.ErrorList
- type Cluster
- func (webhook *Cluster) Default(ctx context.Context, obj runtime.Object) error
- func (webhook *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *Cluster) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *Cluster) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
- func (webhook *Cluster) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)
- type ClusterCacheReader
- type ClusterClass
- func (webhook *ClusterClass) Default(_ context.Context, obj runtime.Object) error
- func (webhook *ClusterClass) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *ClusterClass) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *ClusterClass) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *ClusterClass) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)
- type Machine
- func (webhook *Machine) Default(_ context.Context, obj runtime.Object) error
- func (webhook *Machine) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *Machine) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *Machine) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
- func (webhook *Machine) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)
- type MachineDeployment
- func (webhook *MachineDeployment) Default(ctx context.Context, obj runtime.Object) error
- func (webhook *MachineDeployment) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *MachineDeployment) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *MachineDeployment) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
- func (webhook *MachineDeployment) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)
- type MachineDrainRule
- func (webhook *MachineDrainRule) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *MachineDrainRule) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *MachineDrainRule) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
- func (webhook *MachineDrainRule) ValidateUpdate(_ context.Context, _, newObj runtime.Object) (admission.Warnings, error)
- type MachineHealthCheck
- func (webhook *MachineHealthCheck) Default(_ context.Context, obj runtime.Object) error
- func (webhook *MachineHealthCheck) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *MachineHealthCheck) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *MachineHealthCheck) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
- func (webhook *MachineHealthCheck) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)
- type MachineSet
- func (webhook *MachineSet) Default(ctx context.Context, obj runtime.Object) error
- func (webhook *MachineSet) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (webhook *MachineSet) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)
- func (webhook *MachineSet) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
- func (webhook *MachineSet) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)
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
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.
func ValidateMachineDrainRulesSelectors ¶ added in v1.9.0
func ValidateMachineDrainRulesSelectors(machineDrainRule *clusterv1.MachineDrainRule) field.ErrorList
ValidateMachineDrainRulesSelectors validate the selectors of a MachineDrainRule. Note: This func is exported so it can be also used to validate selectors in the Machine controller.
Types ¶
type Cluster ¶
type Cluster struct { Client client.Reader ClusterCacheReader ClusterCacheReader // contains filtered or unexported fields }
Cluster implements a validating and defaulting webhook for Cluster.
func (*Cluster) SetupWebhookWithManager ¶
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.
type ClusterCacheReader ¶ added in v1.9.0
type ClusterCacheReader interface {
GetReader(ctx context.Context, cluster client.ObjectKey) (client.Reader, error)
}
ClusterCacheReader is a scoped-down interface from ClusterCacheTracker that only allows to get a reader client.
type ClusterClass ¶
ClusterClass implements a validation and defaulting webhook for ClusterClass.
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
Default implements webhook.Defaulter so a webhook will be registered for the type.
func (*Machine) SetupWebhookWithManager ¶ added in v1.6.0
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.
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) 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 MachineDrainRule ¶ added in v1.9.0
type MachineDrainRule struct{}
MachineDrainRule implements a validation webhook for MachineDrainRule.
func (*MachineDrainRule) SetupWebhookWithManager ¶ added in v1.9.0
func (webhook *MachineDrainRule) SetupWebhookWithManager(mgr ctrl.Manager) error
func (*MachineDrainRule) ValidateCreate ¶ added in v1.9.0
func (webhook *MachineDrainRule) ValidateCreate(_ context.Context, obj runtime.Object) (admission.Warnings, error)
ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type.
func (*MachineDrainRule) ValidateDelete ¶ added in v1.9.0
func (webhook *MachineDrainRule) ValidateDelete(_ context.Context, _ runtime.Object) (admission.Warnings, error)
ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type.
func (*MachineDrainRule) ValidateUpdate ¶ added in v1.9.0
func (webhook *MachineDrainRule) ValidateUpdate(_ context.Context, _, newObj runtime.Object) (admission.Warnings, error)
ValidateUpdate implements webhook.CustomValidator 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
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) 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.
Source Files ¶
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. |