validation

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExtendedResourceName added in v0.1.18

func IsExtendedResourceName(name corev1.ResourceName) bool

IsExtendedResourceName returns true if: 1. the resource name is not in the default namespace; 2. resource name does not have "requests." prefix, to avoid confusion with the convention in quota 3. it satisfies the rules in IsQualifiedName() after converted into quota resource name

func IsIntegerResourceName added in v0.1.18

func IsIntegerResourceName(str string) bool

IsIntegerResourceName returns true if the resource is measured in integer values

func IsNativeResource added in v0.1.18

func IsNativeResource(name corev1.ResourceName) bool

IsNativeResource returns true if the resource name is in the *kubernetes.io/ namespace. Partially-qualified (unprefixed) names are implicitly in the kubernetes.io/ namespace.

func IsQuotaHugePageResourceName added in v0.1.18

func IsQuotaHugePageResourceName(name corev1.ResourceName) bool

IsQuotaHugePageResourceName returns true if the resource name has the quota related huge page resource prefix.

func IsResourceQuotaScopeValidForResource added in v0.1.18

func IsResourceQuotaScopeValidForResource(scope corev1.ResourceQuotaScope, resource string) bool

IsResourceQuotaScopeValidForResource returns true if the resource applies to the specified scope

func IsStandardQuotaResourceName added in v0.1.18

func IsStandardQuotaResourceName(str string) bool

IsStandardQuotaResourceName returns true if the resource is known to the quota tracking system

func IsStandardResourceName added in v0.1.18

func IsStandardResourceName(str string) bool

IsStandardResourceName returns true if the resource is known to the system

func IsStandardResourceQuotaScope added in v0.1.18

func IsStandardResourceQuotaScope(str string) bool

IsStandardResourceQuotaScope returns true if the scope is a standard value

func ValidateAccount

func ValidateAccount(account *configv1alpha1.Account) field.ErrorList

ValidateAccount tests required fields for an account

func ValidateAccountQuota

func ValidateAccountQuota(accountQuota *configv1alpha1.AccountQuota) field.ErrorList

ValidateAccountQuota tests required fields for an account quota

func ValidateAccountQuotaSpec added in v0.1.18

func ValidateAccountQuotaSpec(accountQuotaSpec *configv1alpha1.AccountQuotaSpec) field.ErrorList

func ValidateAccountQuotaUpdate

func ValidateAccountQuotaUpdate(newAccountQuota *configv1alpha1.AccountQuota, oldAccountQuota *configv1alpha1.AccountQuota) field.ErrorList

ValidateAccountQuotaUpdate tests updated fields for an account quota

func ValidateAccountSpaceTemplate added in v0.1.12

func ValidateAccountSpaceTemplate(space configv1alpha1.AccountSpaceTemplate, fldPath *field.Path) field.ErrorList

ValidateAccountSpaceTemplate is exported to validate space template labels and reuse this validation logic

func ValidateAccountUpdate

func ValidateAccountUpdate(newAccount *configv1alpha1.Account, oldAccount *configv1alpha1.Account) field.ErrorList

ValidateAccountUpdate tests updated fields for an account

func ValidateNonnegativeQuantity added in v0.1.18

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

Validates that a Quantity is not negative

func ValidateResourceQuantityValue added in v0.1.18

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

ValidateResourceQuantityValue enforces that specified quantity is valid for specified resource

func ValidateResourceQuotaResourceName added in v0.1.18

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

Validate resource names that can go in a resource quota Refer to docs/design/resources.md for more details.

func ValidateResourceQuotaSpec added in v0.1.18

func ValidateResourceQuotaSpec(resourceQuotaSpec *corev1.ResourceQuotaSpec, fld *field.Path) field.ErrorList

func ValidateRoleBindingSubject

func ValidateRoleBindingSubject(subject rbac.Subject, isNamespaced bool, fldPath *field.Path) field.ErrorList

ValidateRoleBindingSubject is exported to allow types outside of the RBAC API group to embed a rbac.Subject and reuse this validation logic

func ValidateTemplateInstance

func ValidateTemplateInstance(templateInstance *configv1alpha1.TemplateInstance) field.ErrorList

ValidateTemplateInstance tests required fields for an account quota

func ValidateTemplateInstanceUpdate

func ValidateTemplateInstanceUpdate(newTemplateInstance *configv1alpha1.TemplateInstance, oldTemplateInstance *configv1alpha1.TemplateInstance) field.ErrorList

ValidateTemplateInstanceUpdate tests updated fields for an account quota

Types

This section is empty.

Jump to

Keyboard shortcuts

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