utils

package
v1.10.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextRegex = `^.+:\sreference\s\"context\"\snot\sfound$`

ContextRegex to match '**: reference "context" not found'

Functions

func IsAddonDefinition added in v1.10.4

func IsAddonDefinition(obj client.Object) bool

IsAddonDefinition checks if the object is part of an addon installation This is a generic solution that works for ALL addons by checking owner references

func ValidateCueTemplate added in v1.9.7

func ValidateCueTemplate(cueTemplate string) error

ValidateCueTemplate validate cueTemplate

func ValidateCuexTemplate added in v1.10.4

func ValidateCuexTemplate(ctx context.Context, cueTemplate string) error

ValidateCuexTemplate validate cueTemplate with CueX for types utilising it

func ValidateDefinitionRevision

func ValidateDefinitionRevision(ctx context.Context, cli client.Client, def runtime.Object, defRevNamespacedName types.NamespacedName) error

ValidateDefinitionRevision validate whether definition will modify the immutable object definitionRevision

func ValidateMultipleDefVersionsNotPresent added in v1.10.0

func ValidateMultipleDefVersionsNotPresent(version, revisionName, objectType string) error

ValidateMultipleDefVersionsNotPresent validates that both Name Annotation Revision and Spec.Version are not present

func ValidateOutputResourcesExist added in v1.10.4

func ValidateOutputResourcesExist(cueTemplate string, mapper meta.RESTMapper, obj client.Object) error

ValidateOutputResourcesExist validates that resources referenced in output/outputs fields exist on the cluster

func ValidateSemanticVersion added in v1.10.0

func ValidateSemanticVersion(version string) error

ValidateSemanticVersion validates if a Definition's version includes all of major,minor & patch version values.

Types

type ResourceInfo added in v1.10.4

type ResourceInfo struct {
	APIVersion string
	Kind       string
	Name       string // optional, for better error messages
}

func ExtractResourceInfo added in v1.10.4

func ExtractResourceInfo(cueTemplate string) ([]ResourceInfo, error)

ExtractResourceInfo extracts apiVersion and kind from CUE template without evaluation

Jump to

Keyboard shortcuts

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