validation

package
v0.121.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const InstallationGenerateNameMaxLength = InstallationNameMaxLength - 5

InstallationGenerateNameMaxLength is the max length of an installation name minus the number of random characters kubernetes uses to generate a unique name

InstallationNameMaxLength is the max allowed length of an installation name

Variables

View Source
var IsIndexedRegex = regexp.MustCompile(`(?P<imp>.*)\[(?P<idx>.*)\]$`)

Functions

func IsIndexed

func IsIndexed(ref string) (bool, string)

IsIndexed checks whether a string is 'indexed' A string is considered to be indexed if it ends with a pair of square brackets containing an int (the index in a target list) or a string (the key in a target map). The first return value is true if the string is indexed. The second return value contains the part before the square brackets, or the whole string if it is not indexed.

func ValidateBlueprint

func ValidateBlueprint(blueprint *core.Blueprint) field.ErrorList

ValidateBlueprint validates a Blueprint

func ValidateBlueprintExportDefinitions

func ValidateBlueprintExportDefinitions(fldPath *field.Path, exports []core.ExportDefinition) field.ErrorList

ValidateBlueprintExportDefinitions validates a list of export definitions

func ValidateBlueprintImportDefinitions

func ValidateBlueprintImportDefinitions(fldPath *field.Path, imports []core.ImportDefinition) field.ErrorList

ValidateBlueprintImportDefinitions validates a list of import definitions

func ValidateBlueprintWithInstallationTemplates

func ValidateBlueprintWithInstallationTemplates(blueprint *core.Blueprint, installationTemplates []*core.InstallationTemplate) field.ErrorList

ValidateBlueprintWithInstallationTemplates validates a Blueprint

func ValidateDeployItem

func ValidateDeployItem(di *core.DeployItem) field.ErrorList

ValidateDeployItem validates a DeployItem

func ValidateDeployItemSpec

func ValidateDeployItemSpec(fldPath *field.Path, diSpec core.DeployItemSpec) field.ErrorList

ValidateDeployItemSpec validates a DeployItem spec

func ValidateDeployItemTemplate

func ValidateDeployItemTemplate(fldPath *field.Path, tmpl core.DeployItemTemplate) field.ErrorList

ValidateDeployItemTemplate validates a deploy item template.

func ValidateDeployItemTemplateList

func ValidateDeployItemTemplateList(fldPath *field.Path, list core.DeployItemTemplateList) field.ErrorList

ValidateDeployItemTemplateList validates a list of deploy item templates.

func ValidateExactlyOneOf

func ValidateExactlyOneOf(fldPath *field.Path, input interface{}, configs ...string) field.ErrorList

ValidateExactlyOneOf is a helper function that takes a struct and a list of field names and validates that exactly one of the specified fields has a non-nil, non-zero value. If that's the case, an empty ErrorList will be returned. If the given struct is a nil pointer, this will be treated as all fields being nil/zero and return an error.

func ValidateExecution

func ValidateExecution(execution *core.Execution) field.ErrorList

ValidateExecution validates an Execution

func ValidateExecutionSpec

func ValidateExecutionSpec(fldpath *field.Path, spec core.ExecutionSpec) field.ErrorList

ValidateExecutionSpec validtes the spec of a execution object

func ValidateFieldValueDefinition

func ValidateFieldValueDefinition(fldPath *field.Path, def core.FieldValueDefinition) field.ErrorList

ValidateFieldValueDefinition validates a field value definition

func ValidateInstallation

func ValidateInstallation(inst *core.Installation) field.ErrorList

ValidateInstallation validates an Installation

func ValidateInstallationAutomaticReconcile added in v0.105.0

func ValidateInstallationAutomaticReconcile(automaticReconcile *core.AutomaticReconcile, fldPath *field.Path) field.ErrorList

func ValidateInstallationBlueprint

func ValidateInstallationBlueprint(bp core.BlueprintDefinition, fldPath *field.Path) field.ErrorList

ValidateInstallationBlueprint validates the Blueprint definition of an Installation

func ValidateInstallationComponentDescriptor

func ValidateInstallationComponentDescriptor(cd *core.ComponentDescriptorDefinition, fldPath *field.Path) field.ErrorList

ValidateInstallationComponentDescriptor validates the ComponentDesriptor of an Installation

func ValidateInstallationDataExports

func ValidateInstallationDataExports(exports []core.DataExport, fldPath *field.Path) field.ErrorList

ValidateInstallationDataExports validates the data exports of an Installation

func ValidateInstallationDataImports

func ValidateInstallationDataImports(imports []core.DataImport, fldPath *field.Path, importNames sets.String) (field.ErrorList, sets.String)

ValidateInstallationDataImports validates the data imports of an Installation

func ValidateInstallationExports

func ValidateInstallationExports(exports core.InstallationExports, fldPath *field.Path) field.ErrorList

ValidateInstallationExports validates the exports of an Installation

func ValidateInstallationFailedReconcile added in v0.105.0

func ValidateInstallationFailedReconcile(failedReconcile *core.FailedReconcile, fldPath *field.Path) field.ErrorList

func ValidateInstallationImports

func ValidateInstallationImports(imports core.InstallationImports, fldPath *field.Path) field.ErrorList

ValidateInstallationImports validates the imports of an Installation

func ValidateInstallationSpec

func ValidateInstallationSpec(spec *core.InstallationSpec, fldPath *field.Path) field.ErrorList

ValidateInstallationSpec validates the spec of an Installation

func ValidateInstallationSucceededReconcile added in v0.105.0

func ValidateInstallationSucceededReconcile(succeededReconcile *core.SucceededReconcile, fldPath *field.Path) field.ErrorList

func ValidateInstallationTargetExports

func ValidateInstallationTargetExports(exports []core.TargetExport, fldPath *field.Path) field.ErrorList

ValidateInstallationTargetExports validates the target exports of an Installation

func ValidateInstallationTargetImports

func ValidateInstallationTargetImports(imports []core.TargetImport, fldPath *field.Path, importNames sets.String) (field.ErrorList, sets.String)

ValidateInstallationTargetImports validates the target imports of an Installation

func ValidateInstallationTemplate

func ValidateInstallationTemplate(fldPath *field.Path, template *core.InstallationTemplate) field.ErrorList

ValidateInstallationTemplate validates a installation template

func ValidateInstallationTemplateDataImports

func ValidateInstallationTemplateDataImports(imports []core.DataImport, fldPath *field.Path, importNames sets.String) (field.ErrorList, sets.String)

ValidateInstallationTemplateDataImports validates the data imports of an InstallationTemplate

func ValidateInstallationTemplateImports

func ValidateInstallationTemplateImports(imports core.InstallationImports, fldPath *field.Path) field.ErrorList

ValidateInstallationTemplateImports validates the imports of an InstallationTemplate

func ValidateInstallationTemplates

func ValidateInstallationTemplates(fldPath *field.Path, blueprintImportDefs []core.ImportDefinition, subinstallations []*core.InstallationTemplate) field.ErrorList

ValidateInstallationTemplates validates a list of subinstallations. Take care to also include all templated templates for proper validation.

func ValidateJsonSchema

func ValidateJsonSchema(fldPath *field.Path, schema *core.JSONSchemaDefinition) field.ErrorList

ValidateJsonSchema validates a json schema

func ValidateLocalConfigMapReference

func ValidateLocalConfigMapReference(cmr core.LocalConfigMapReference, fldPath *field.Path) field.ErrorList

ValidateLocalConfigMapReference validates that the local configmap reference is valid

func ValidateLocalSecretReference

func ValidateLocalSecretReference(sr core.LocalSecretReference, fldPath *field.Path) field.ErrorList

ValidateLocalSecretReference validates that the local secret reference is valid

func ValidateObjectReference

func ValidateObjectReference(or core.ObjectReference, fldPath *field.Path) field.ErrorList

ValidateObjectReference validates that the object reference is valid

func ValidateObjectReferenceList

func ValidateObjectReferenceList(orl []core.ObjectReference, fldPath *field.Path) field.ErrorList

ValidateObjectReferenceList validates a list of object references

func ValidateSatisfiedImports

func ValidateSatisfiedImports(blueprintImports, blueprintListImports, blueprintMapImports, exports sets.String, imports []Import) field.ErrorList

ValidateSatisfiedImports validates that all imports are satisfied.

func ValidateSubinstallations

func ValidateSubinstallations(fldPath *field.Path, subinstallations []core.SubinstallationTemplate) field.ErrorList

ValidateSubinstallations validates all inline subinstallation and installation templates from a file

func ValidateTarget

func ValidateTarget(target *core.Target) field.ErrorList

ValidateTarget validates a Target

func ValidateTargetSpec

func ValidateTargetSpec(spec *core.TargetSpec, fldPath *field.Path) field.ErrorList

func ValidateTemplateExecutorList

func ValidateTemplateExecutorList(fldPath *field.Path, list []core.TemplateExecutor) field.ErrorList

ValidateTemplateExecutorList validates a list of template executors

Types

type Cycle

type Cycle []string

Cycle represents a cycle of dependencies

type Import

type Import struct {
	Name              string
	Path              *field.Path
	IsListImport      bool
	IsTargetMapImport bool
}

Import defines a internal import struct for validation.

type UndefinedDeployItemReference

type UndefinedDeployItemReference struct {
	Source string
	Target string
}

UndefinedDeployItemReference represents a dependency to an undefined deploy item

Jump to

Keyboard shortcuts

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