packagevalidation

package
v1.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

DefaultObjectValidators is a list of object validators that should be executed as a minimum standard.

DefaultPackageValidators is a list of package validators that should be executed as a minimum standard.

Functions

func ValidateEachObject

func ValidateEachObject(
	ctx context.Context,
	manifest *manifests.PackageManifest,
	objects map[string][]unstructured.Unstructured,
	validate ValidateEachObjectFn,
) error

ValidateEachObject iterates over each object in a package and runs the given validation function.

Types

type LockfileConsistencyValidator added in v1.10.0

type LockfileConsistencyValidator struct{}

Validates that the PackageManifestLock is consistent with PackageManifest.

func (*LockfileConsistencyValidator) ValidatePackage added in v1.10.0

func (v *LockfileConsistencyValidator) ValidatePackage(
	_ context.Context, pkg *packagetypes.Package,
) error

type LockfileDigestLookupValidator added in v1.10.0

type LockfileDigestLookupValidator struct {
	// Options passed to crane when looking up the digest.
	CraneOptions []crane.Option
	// contains filtered or unexported fields
}

Validates that images referenced in the lockfile are still present in the registry.

func (*LockfileDigestLookupValidator) ValidatePackage added in v1.10.0

func (v *LockfileDigestLookupValidator) ValidatePackage(
	_ context.Context, pkg *packagetypes.Package,
) error

type ObjectDuplicateValidator

type ObjectDuplicateValidator struct{}

Validates that Objects with the same name/namespace/kind/group must only exist once over all phases. APIVersion does not matter for the check.

func (*ObjectDuplicateValidator) ValidateObjects

type ObjectGVKValidator

type ObjectGVKValidator struct{}

Validates that every object has Group, Version and Kind set. e.g. apiVersion: and kind:.

func (*ObjectGVKValidator) ValidateObjects

func (v *ObjectGVKValidator) ValidateObjects(
	ctx context.Context,
	manifest *manifests.PackageManifest,
	objects map[string][]unstructured.Unstructured,
) error

type ObjectLabelsValidator

type ObjectLabelsValidator struct{}

Validates that all labels are valid.

func (*ObjectLabelsValidator) ValidateObjects

func (v *ObjectLabelsValidator) ValidateObjects(
	ctx context.Context,
	manifest *manifests.PackageManifest,
	objects map[string][]unstructured.Unstructured,
) error

type ObjectPhaseAnnotationValidator

type ObjectPhaseAnnotationValidator struct{}

Validates that the PKO phase-annotation is set on all objects.

func (*ObjectPhaseAnnotationValidator) ValidateObjects

func (v *ObjectPhaseAnnotationValidator) ValidateObjects(
	ctx context.Context,
	manifest *manifests.PackageManifest,
	objects map[string][]unstructured.Unstructured,
) error

type ObjectValidatorList

type ObjectValidatorList []packagetypes.ObjectValidator

ObjectValidatorList runs a list of validators and joins all errors.

func (ObjectValidatorList) ValidateObjects

func (l ObjectValidatorList) ValidateObjects(
	ctx context.Context,
	manifest *manifests.PackageManifest,
	objects map[string][]unstructured.Unstructured,
) error

type PackageManifestValidator

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

Validates PackageManifests and PackageManifestLock.

func (*PackageManifestValidator) ValidatePackage

func (v *PackageManifestValidator) ValidatePackage(ctx context.Context, pkg *packagetypes.Package) error

type PackageScopeValidator

type PackageScopeValidator manifests.PackageManifestScope

Validates a Package is able to be installed in the given scope.

func (PackageScopeValidator) ValidatePackage

func (scope PackageScopeValidator) ValidatePackage(_ context.Context, pkg *packagetypes.Package) error

type PackageValidatorList

type PackageValidatorList []packagetypes.PackageValidator

PackageValidatorList runs a list of validators and joins all errors.

func (PackageValidatorList) ValidatePackage

func (l PackageValidatorList) ValidatePackage(ctx context.Context, pkg *packagetypes.Package) error

type TemplateTestValidator

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

Runs the template test suites.

func NewTemplateTestValidator

func NewTemplateTestValidator(
	packageBaseFolderPath string,
) *TemplateTestValidator

Creates a new TemplateTestValidator instance.

func (TemplateTestValidator) ValidatePackage

func (v TemplateTestValidator) ValidatePackage(
	ctx context.Context, pkg *packagetypes.Package,
) error

type ValidateEachObjectFn

type ValidateEachObjectFn func(
	ctx context.Context, path string, index int,
	obj unstructured.Unstructured, manifest *manifests.PackageManifest,
) error

Function given to ValidateEachObject to validate individual objects in a package.

Jump to

Keyboard shortcuts

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