namespace

package
v1.9.0-industry.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidateNamespaceName = apimachineryvalidation.NameIsDNSLabel

ValidateNamespaceName is a ValidateNameFunc for names that must be a DNS subdomain.

Functions

func GetAttrs

func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error)

GetAttrs returns labels and fields of a given object for filtering purposes.

func MatchNamespace

func MatchNamespace(label labels.Selector, field fields.Selector) storage.SelectionPredicate

MatchNamespace returns a generic matcher for a given label and field selector.

func ToSelectableFields

func ToSelectableFields(namespace *business.Namespace) fields.Set

ToSelectableFields returns a field set that represents the object

func ValidateAgainstProject added in v1.3.1

func ValidateAgainstProject(namespace, old *business.Namespace, project *business.Project, fldProject, fldHard *field.Path) field.ErrorList

ValidateAgainstProject validates namespace against project.

func ValidateNamespace

func ValidateNamespace(ctx context.Context, namespace *business.Namespace, old *business.Namespace,
	objectGetter validation.BusinessObjectGetter, clusterGetter validation.ClusterGetter) field.ErrorList

ValidateNamespace tests if required fields in the namespace are set.

func ValidateNamespaceEmigrate added in v1.3.1

func ValidateNamespaceEmigrate(namespace *business.Namespace, old *business.Namespace) field.ErrorList

func ValidateNamespaceUpdate

func ValidateNamespaceUpdate(ctx context.Context, namespace *business.Namespace, old *business.Namespace,
	objectGetter validation.BusinessObjectGetter, clusterGetter validation.ClusterGetter) field.ErrorList

ValidateNamespaceUpdate tests if required fields in the namespace are set during an update.

Types

type FinalizeStrategy

type FinalizeStrategy struct {
	*Strategy
}

FinalizeStrategy implements verification logic for status of Namespace.

func NewFinalizeStrategy

func NewFinalizeStrategy(strategy *Strategy) *FinalizeStrategy

NewFinalizeStrategy create the FinalizeStrategy object by given strategy.

func (FinalizeStrategy) PrepareForUpdate

func (FinalizeStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)

PrepareForUpdate is invoked on update before validation to normalize the object. For example: remove fields that are not to be persisted, sort order-insensitive list fields, etc. This should not remove fields whose presence would be considered a validation error.

func (*FinalizeStrategy) ValidateUpdate

func (s *FinalizeStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList

ValidateUpdate is invoked after default fields in the object have been filled in before the object is persisted. This method should not mutate the object.

type StatusStrategy

type StatusStrategy struct {
	*Strategy
}

StatusStrategy implements verification logic for status of Namespace.

func NewStatusStrategy

func NewStatusStrategy(strategy *Strategy) *StatusStrategy

NewStatusStrategy create the StatusStrategy object by given strategy.

func (StatusStrategy) PrepareForUpdate

func (StatusStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)

PrepareForUpdate is invoked on update before validation to normalize the object. For example: remove fields that are not to be persisted, sort order-insensitive list fields, etc. This should not remove fields whose presence would be considered a validation error.

func (*StatusStrategy) ValidateUpdate

func (s *StatusStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList

ValidateUpdate is invoked after default fields in the object have been filled in before the object is persisted. This method should not mutate the object.

type Strategy

type Strategy struct {
	runtime.ObjectTyper
	names.NameGenerator
	// contains filtered or unexported fields
}

Strategy implements verification logic for namespace.

func NewStrategy

NewStrategy creates a strategy that is the default logic that applies when creating and updating namespace objects.

func (*Strategy) AfterCreate

func (s *Strategy) AfterCreate(obj runtime.Object) error

AfterCreate implements a further operation to run after a resource is created and before it is decorated, optional.

func (Strategy) AllowCreateOnUpdate

func (Strategy) AllowCreateOnUpdate() bool

AllowCreateOnUpdate is false for namespaces.

func (Strategy) AllowUnconditionalUpdate

func (Strategy) AllowUnconditionalUpdate() bool

AllowUnconditionalUpdate returns true if the object can be updated unconditionally (irrespective of the latest resource version), when there is no resource version specified in the object.

func (Strategy) Canonicalize

func (Strategy) Canonicalize(obj runtime.Object)

Canonicalize normalizes the object after validation.

func (Strategy) DefaultGarbageCollectionPolicy

func (Strategy) DefaultGarbageCollectionPolicy(ctx context.Context) rest.GarbageCollectionPolicy

DefaultGarbageCollectionPolicy returns the default garbage collection behavior.

func (Strategy) Export

func (Strategy) Export(ctx context.Context, obj runtime.Object, exact bool) error

Export strips fields that can not be set by the user.

func (Strategy) NamespaceScoped

func (Strategy) NamespaceScoped() bool

NamespaceScoped is false for namespaces.

func (*Strategy) PrepareForCreate

func (s *Strategy) PrepareForCreate(ctx context.Context, obj runtime.Object)

PrepareForCreate is invoked on create before validation to normalize the object.

func (Strategy) PrepareForUpdate

func (Strategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Object)

PrepareForUpdate is invoked on update before validation to normalize the object.

func (*Strategy) Validate

func (s *Strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList

Validate validates a new namespace.

func (*Strategy) ValidateUpdate

func (s *Strategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList

ValidateUpdate is the default update validation for an end namespace.

func (Strategy) WarningsOnCreate added in v1.9.0

func (Strategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []string

WarningsOnCreate returns warnings for the creation of the given object.

func (Strategy) WarningsOnUpdate added in v1.9.0

func (Strategy) WarningsOnUpdate(ctx context.Context, obj, old runtime.Object) []string

WarningsOnUpdate returns warnings for the given update.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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