validation

package
v1.18.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CrdsArchive = []string{"crds", "crds/bases", "crds/patches"}

CrdsArchive defines the expected tar archive.

Functions

func ValidateApplicationFailover added in v1.6.0

func ValidateApplicationFailover(applicationFailoverBehavior *policyv1alpha1.ApplicationFailoverBehavior, fldPath *field.Path) field.ErrorList

ValidateApplicationFailover validates that the application failover is correctly defined.

func ValidateClusterAffinities added in v1.5.0

func ValidateClusterAffinities(affinities []policyv1alpha1.ClusterAffinityTerm, fldPath *field.Path) field.ErrorList

ValidateClusterAffinities validates clusterAffinities before creation or update.

func ValidateClusterAffinity added in v1.5.0

func ValidateClusterAffinity(affinity *policyv1alpha1.ClusterAffinity, fldPath *field.Path) field.ErrorList

ValidateClusterAffinity validates a clusterAffinity before creation or update.

func ValidateCrdsTarBall added in v1.12.0

func ValidateCrdsTarBall(header *tar.Header) error

ValidateCrdsTarBall checks if the CRDs package complies with file specifications. It verifies the following: 1. Whether the path is clean. 2. Whether the file directory structure meets expectations.

func ValidateFailover added in v1.6.0

func ValidateFailover(failoverBehavior *policyv1alpha1.FailoverBehavior, fldPath *field.Path) field.ErrorList

ValidateFailover validates that the failoverBehavior is correctly defined.

func ValidateOverflowAffinities

func ValidateOverflowAffinities(affinity policyv1alpha1.ClusterAffinityTerm, fldPath *field.Path) field.ErrorList

ValidateOverflowAffinities validates the overflowAffinities of a ClusterAffinityTerm. It checks: 1. OverflowAffinities can only be set when the inline ClusterAffinity is non-empty. 2. Each overflow affinity name must be a valid label key. 3. Overflow affinity names must be unique and must not duplicate the primary group's affinityName. 4. Each overflow affinity's ClusterAffinity is validated recursively.

func ValidateOverrideRules added in v1.5.0

func ValidateOverrideRules(overrideRules []policyv1alpha1.RuleWithCluster, fldPath *field.Path) field.ErrorList

ValidateOverrideRules validates the overrideRules of override policy.

func ValidateOverrideSpec added in v1.0.0

func ValidateOverrideSpec(overrideSpec *policyv1alpha1.OverrideSpec, policyNamespace string) field.ErrorList

ValidateOverrideSpec validates that the overrider specification is correctly defined.

func ValidatePlacement added in v1.5.0

func ValidatePlacement(placement policyv1alpha1.Placement, fldPath *field.Path) field.ErrorList

ValidatePlacement validates a placement before creation or update.

func ValidatePolicyFieldSelector added in v0.6.0

func ValidatePolicyFieldSelector(fieldSelector *policyv1alpha1.FieldSelector) error

ValidatePolicyFieldSelector tests if the fieldSelector of propagation policy or override policy is valid.

func ValidatePropagationSpec added in v1.5.0

func ValidatePropagationSpec(spec policyv1alpha1.PropagationSpec, policyNamespace string) field.ErrorList

ValidatePropagationSpec validates a PropagationSpec before creation or update.

func ValidateSpreadConstraint added in v1.5.0

func ValidateSpreadConstraint(spreadConstraints []policyv1alpha1.SpreadConstraint, fldPath *field.Path) field.ErrorList

ValidateSpreadConstraint tests if the constraints is valid.

func ValidateTarball added in v1.12.0

func ValidateTarball(tarball string, validate func(*tar.Header) error) error

ValidateTarball opens a .tar.gz file, and validates each entry in the tar archive using a provided validate function.

func ValidateWorkloadAffinity added in v1.17.0

func ValidateWorkloadAffinity(workloadAffinity *policyv1alpha1.WorkloadAffinity, fldPath *field.Path) field.ErrorList

ValidateWorkloadAffinity validates a workloadAffinity before creation or update.

Types

This section is empty.

Jump to

Keyboard shortcuts

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