k8svalidation

package
v1.29.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright (c) 2022 Tigera, Inc. All rights reserved.

Copyright 2014 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The contents of this file are mostly copied, with minor modifications, from: https://github.com/kubernetes/kubernetes/blob/f38615fb9d1188934213633ff92d523259ae8f6a/pkg/apis/core/v1/validation/validation.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotMoreThan100Percent

func IsNotMoreThan100Percent(intOrStringValue intstr.IntOrString, fldPath *field.Path) field.ErrorList

func ValidateAffinity

func ValidateAffinity(affinity *core.Affinity, fldPath *field.Path) field.ErrorList

ValidateAffinity checks if given affinities are valid

func ValidateAnnotations

func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList

ValidateAnnotations validates that a set of annotations are correctly defined.

func ValidateContainerResourceName

func ValidateContainerResourceName(value string, fldPath *field.Path) field.ErrorList

ValidateContainerResourceName checks the name of resource specified for a container

func ValidateDeploymentStrategy

func ValidateDeploymentStrategy(strategy *appsv1.DeploymentStrategy, fldPath *field.Path) field.ErrorList

ValidateDeploymentStrategy validates given DeploymentStrategy.

func ValidateLabels

func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorList

ValidateLabels validates the given labels.

func ValidateMaxSkew added in v1.29.0

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

ValidateMaxSkew tests that the argument is a valid MaxSkew.

func ValidateNodeFieldSelectorRequirement

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

ValidateNodeFieldSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data

func ValidateNodeSelector

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

ValidateNodeSelector tests that the specified nodeSelector fields has valid data

func ValidateNodeSelectorRequirement

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

ValidateNodeSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data

func ValidateNodeSelectorTerm

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

ValidateNodeSelectorTerm tests that the specified node selector term has valid data

func ValidateNonnegativeQuantity

func ValidateNonnegativeQuantity(value resource.Quantity, fldPath *field.Path) field.ErrorList

ValidateNonnegativeQuantity checks that a Quantity is not negative.

func ValidatePodSpecNodeSelector

func ValidatePodSpecNodeSelector(nodeSelector map[string]string, fldPath *field.Path) field.ErrorList

ValidatePodSpecNodeSelector validates the given pod spec nodeSelector.

func ValidatePositiveIntOrPercent

func ValidatePositiveIntOrPercent(intOrPercent intstr.IntOrString, fldPath *field.Path) field.ErrorList

func ValidatePreferredSchedulingTerms

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

ValidatePreferredSchedulingTerms tests that the specified SoftNodeAffinity fields has valid data

func ValidateQualifiedName

func ValidateQualifiedName(value string, fldPath *field.Path) field.ErrorList

ValidateQualifiedName validates if name is what Kubernetes calls a "qualified name".

func ValidateResourceQuantityValue

func ValidateResourceQuantityValue(resource string, value resource.Quantity, fldPath *field.Path) field.ErrorList

ValidateResourceQuantityValue enforces that specified quantity is valid for specified resource

func ValidateResourceRequirements

func ValidateResourceRequirements(requirements *v1.ResourceRequirements, fldPath *field.Path) field.ErrorList

ValidateResourceRequirements will check if any of the resource Limits/Requests are of a valid value. Any incorrect value will be added to the ErrorList.

func ValidateRollingUpdateDeployment

func ValidateRollingUpdateDeployment(rollingUpdate *appsv1.RollingUpdateDeployment, fldPath *field.Path) field.ErrorList

ValidateRollingUpdateDeployment validates a given RollingUpdateDeployment.

func ValidateSpreadConstraintNotRepeat added in v1.29.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 ValidateTolerations

func ValidateTolerations(tolerations []core.Toleration, fldPath *field.Path) field.ErrorList

ValidateTolerations tests if given tolerations have valid data.

func ValidateTopologyKey added in v1.29.0

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

ValidateTopologyKey tests that the argument is a valid TopologyKey.

func ValidateTopologySpreadConstraints added in v1.29.0

func ValidateTopologySpreadConstraints(constraints []core.TopologySpreadConstraint, fldPath *field.Path) field.ErrorList

ValidateTopologySpreadConstraints validates given TopologySpreadConstraints.

func ValidateWhenUnsatisfiable added in v1.29.0

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

ValidateWhenUnsatisfiable tests that the argument is a valid UnsatisfiableConstraintAction.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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