admitters

package
v1.5.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ValidateNamespaceName can be used to check whether the given namespace name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

ValidateNodeName can be used to check whether the given node name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

Functions

func ValidateInstanceTypeSpec added in v1.0.0

func ValidateInstanceTypeSpec(field *k8sfield.Path, spec *instancetypev1beta1.VirtualMachineInstancetypeSpec) []metav1.StatusCause

func ValidateMaxSkew added in v0.57.0

func ValidateMaxSkew(fldPath *field.Path, maxSkew int32) *field.Error

ValidateMaxSkew tests that the argument is a valid MaxSkew.

func ValidateNodeFieldSelectorRequirement added in v0.57.0

func ValidateNodeFieldSelectorRequirement(req core.NodeSelectorRequirement, fldPath *field.Path) field.ErrorList

ValidateNodeFieldSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data

func ValidateNodeSelector added in v0.57.0

func ValidateNodeSelector(nodeSelector *core.NodeSelector, fldPath *field.Path) field.ErrorList

ValidateNodeSelector tests that the specified nodeSelector fields has valid data

func ValidateNodeSelectorRequirement added in v0.57.0

func ValidateNodeSelectorRequirement(rq core.NodeSelectorRequirement, fldPath *field.Path) field.ErrorList

ValidateNodeSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data

func ValidateNodeSelectorTerm added in v0.57.0

func ValidateNodeSelectorTerm(term core.NodeSelectorTerm, fldPath *field.Path) field.ErrorList

ValidateNodeSelectorTerm tests that the specified node selector term has valid data

func ValidatePreferenceSpec added in v1.4.0

func ValidatePreferredSchedulingTerms added in v0.57.0

func ValidatePreferredSchedulingTerms(terms []core.PreferredSchedulingTerm, fldPath *field.Path) field.ErrorList

ValidatePreferredSchedulingTerms tests that the specified SoftNodeAffinity fields has valid data

func ValidateSpreadConstraintNotRepeat added in v0.57.0

func ValidateSpreadConstraintNotRepeat(fldPath *field.Path, constraint core.TopologySpreadConstraint, restingConstraints []core.TopologySpreadConstraint) *field.Error

ValidateSpreadConstraintNotRepeat tests that if `constraint` duplicates with `existingConstraintPairs` on TopologyKey and WhenUnsatisfiable fields.

func ValidateTopologyKey added in v0.57.0

func ValidateTopologyKey(fldPath *field.Path, topologyKey string) field.ErrorList

ValidateTopologyKey tests that the argument is a valid TopologyKey.

func ValidateVMIPresetSpec

func ValidateVMIPresetSpec(field *k8sfield.Path, spec *v1.VirtualMachineInstancePresetSpec) []metav1.StatusCause

func ValidateVMPoolSpec added in v0.49.0

func ValidateVMPoolSpec(ar *admissionv1.AdmissionReview, field *k8sfield.Path, pool *poolv1.VirtualMachinePool, config *virtconfig.ClusterConfig, isKubeVirtServiceAccount bool) []metav1.StatusCause

func ValidateVirtualMachineInstanceMandatoryFields

func ValidateVirtualMachineInstanceMandatoryFields(field *k8sfield.Path, spec *v1.VirtualMachineInstanceSpec) []metav1.StatusCause

ValidateVirtualMachineInstanceMandatoryFields should be invoked after all defaults and presets are applied. It is only meant to be used for VMI reviews, not if they are templates on other objects

func ValidateVirtualMachineInstanceMetadata

func ValidateVirtualMachineInstanceMetadata(field *k8sfield.Path, metadata *metav1.ObjectMeta, config *virtconfig.ClusterConfig, isKubeVirtServiceAccount bool) []metav1.StatusCause

func ValidateVirtualMachineInstanceMigrationSpec

func ValidateVirtualMachineInstanceMigrationSpec(field *k8sfield.Path, spec *v1.VirtualMachineInstanceMigrationSpec) []metav1.StatusCause

func ValidateVirtualMachineInstanceSpec

func ValidateVirtualMachineInstanceSpec(field *k8sfield.Path, spec *v1.VirtualMachineInstanceSpec, config *virtconfig.ClusterConfig) []metav1.StatusCause

func ValidateVirtualMachineSpec

func ValidateVirtualMachineSpec(field *k8sfield.Path, spec *v1.VirtualMachineSpec, config *virtconfig.ClusterConfig, isKubeVirtServiceAccount bool) []metav1.StatusCause

func ValidateWhenUnsatisfiable added in v0.57.0

func ValidateWhenUnsatisfiable(fldPath *field.Path, action core.UnsatisfiableConstraintAction) *field.Error

ValidateWhenUnsatisfiable tests that the argument is a valid UnsatisfiableConstraintAction.

Types

type ClusterInstancetypeAdmitter added in v0.56.0

type ClusterInstancetypeAdmitter struct{}

func (*ClusterInstancetypeAdmitter) Admit added in v0.56.0

type ClusterPreferenceAdmitter added in v0.54.0

type ClusterPreferenceAdmitter struct{}

func (*ClusterPreferenceAdmitter) Admit added in v0.54.0

type InstancetypeAdmitter added in v0.56.0

type InstancetypeAdmitter struct{}

func (*InstancetypeAdmitter) Admit added in v0.56.0

type MigrationCreateAdmitter

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

func NewMigrationCreateAdmitter added in v1.4.0

func NewMigrationCreateAdmitter(virtClient kubevirt.Interface) *MigrationCreateAdmitter

func (*MigrationCreateAdmitter) Admit

type MigrationPolicyAdmitter added in v0.49.0

type MigrationPolicyAdmitter struct {
}

MigrationPolicyAdmitter validates VirtualMachineSnapshots

func NewMigrationPolicyAdmitter added in v0.49.0

func NewMigrationPolicyAdmitter() *MigrationPolicyAdmitter

NewMigrationPolicyAdmitter creates a MigrationPolicyAdmitter

func (*MigrationPolicyAdmitter) Admit added in v0.49.0

Admit validates an AdmissionReview

type MigrationUpdateAdmitter

type MigrationUpdateAdmitter struct {
}

func (*MigrationUpdateAdmitter) Admit

type PodEvictionAdmitter added in v0.34.0

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

func NewPodEvictionAdmitter added in v1.3.0

func NewPodEvictionAdmitter(clusterConfig *virtconfig.ClusterConfig, kubeClient kubernetes.Interface, virtClient kubevirt.Interface) *PodEvictionAdmitter

func (*PodEvictionAdmitter) Admit added in v0.34.0

type PreferenceAdmitter added in v0.54.0

type PreferenceAdmitter struct{}

func (*PreferenceAdmitter) Admit added in v0.54.0

type SpecValidator

SpecValidator validates the given VMI spec

type StatusAdmitter added in v0.33.0

type StatusAdmitter struct {
	VmsAdmitter *VMsAdmitter
}

func (*StatusAdmitter) Admit added in v0.33.0

type VMICreateAdmitter

type VMICreateAdmitter struct {
	ClusterConfig           *virtconfig.ClusterConfig
	SpecValidators          []SpecValidator
	KubeVirtServiceAccounts map[string]struct{}
}

func (*VMICreateAdmitter) Admit

type VMIPresetAdmitter

type VMIPresetAdmitter struct {
}

func (*VMIPresetAdmitter) Admit

type VMIRSAdmitter

type VMIRSAdmitter struct {
	ClusterConfig *virtconfig.ClusterConfig
}

func (*VMIRSAdmitter) Admit

type VMIUpdateAdmitter

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

func NewVMIUpdateAdmitter added in v1.4.0

func NewVMIUpdateAdmitter(config *virtconfig.ClusterConfig, kubeVirtServiceAccounts map[string]struct{}) *VMIUpdateAdmitter

func (*VMIUpdateAdmitter) Admit

type VMPoolAdmitter added in v0.49.0

type VMPoolAdmitter struct {
	ClusterConfig           *virtconfig.ClusterConfig
	KubeVirtServiceAccounts map[string]struct{}
}

func (*VMPoolAdmitter) Admit added in v0.49.0

type VMsAdmitter

type VMsAdmitter struct {
	VirtClient              kubecli.KubevirtClient
	DataSourceInformer      cache.SharedIndexInformer
	NamespaceInformer       cache.SharedIndexInformer
	InstancetypeMethods     instancetype.Methods
	ClusterConfig           *virtconfig.ClusterConfig
	KubeVirtServiceAccounts map[string]struct{}
}

func NewVMsAdmitter added in v0.20.0

func NewVMsAdmitter(clusterConfig *virtconfig.ClusterConfig, client kubecli.KubevirtClient, informers *webhooks.Informers, kubeVirtServiceAccounts map[string]struct{}) *VMsAdmitter

func (*VMsAdmitter) Admit

func (*VMsAdmitter) AdmitStatus added in v0.33.0

type VirtualMachineCloneAdmitter added in v0.55.0

type VirtualMachineCloneAdmitter struct {
	Config *virtconfig.ClusterConfig
	Client kubecli.KubevirtClient
}

VirtualMachineCloneAdmitter validates VirtualMachineClones

func NewVMCloneAdmitter added in v0.55.0

func NewVMCloneAdmitter(config *virtconfig.ClusterConfig, client kubecli.KubevirtClient) *VirtualMachineCloneAdmitter

NewVMCloneAdmitter creates a VM Clone Admitter

func (*VirtualMachineCloneAdmitter) Admit added in v0.55.0

Admit validates an AdmissionReview

Jump to

Keyboard shortcuts

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