cuestomize

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ValidatorAnnotationKey is the annotation key that marks a CUE function as a validator.
	ValidatorAnnotationKey = "config.cuestomize.io/validator"
	// ValidatorAnnotationValue is the value of the annotation that marks a CUE function as a validator.
	ValidatorAnnotationValue = "true"
)
View Source
const (
	// InputFillPath is the CUE path in which the input resources will be injected into the CUE model.
	InputFillPath = "input"
	// IncludesFillPath is the CUE path in which the includes will be injected into the CUE model.
	IncludesFillPath = "includes"

	// OutputsPath is the CUE path in which the function expects the output resources (as a list) to be placed.
	OutputsPath = "outputs"
)
View Source
const (
	// APIVersionFillPath is the CUE path in which the API version of the KRMInput will be filled.
	APIVersionFillPath = "apiVersion"
	// KindFillPath is the CUE path in which the kind of the KRMInput will be filled.
	KindFillPath = "kind"
	// MetadataFillPath is the CUE path in which the metadata of the KRMInput will be filled.
	MetadataFillPath = "metadata"
)

Variables

This section is empty.

Functions

func BuildCUEModelSchema

func BuildCUEModelSchema(ctx *cue.Context, instances []*build.Instance) (*cue.Value, error)

BuildCUEModelSchema builds a CUE model from the provided instances and returns the unified schema.

func CheckInstances

func CheckInstances(instances []*build.Instance) error

CheckInstances checks if any of the instances have an error and returns an error if so.

func Cuestomize

func Cuestomize(items []*kyaml.RNode, config *api.KRMInput, resourcesPath string, ctx context.Context) ([]*kyaml.RNode, error)

Cuestomize generates (or validates) resources from the provided CUE configuration and input resources.

func FillMetadata

func FillMetadata(schema cue.Value, config *api.KRMInput) (cue.Value, error)

FillMetadata fills the CUE schema with the API version, kind, and metadata from the KRMInput configuration.

func LoadCUEModel

func LoadCUEModel(path string) ([]*build.Instance, error)

LoadCUEModel loads a CUE model from the specified path and returns the instances.

func ProcessOutputs

func ProcessOutputs(unified cue.Value, items []*kyaml.RNode, ctx context.Context) ([]*kyaml.RNode, error)

processOutputs processes the outputs from the CUE model and appends them to the output slice.

func ShouldActAsValidator

func ShouldActAsValidator(config *api.KRMInput) bool

ShouldActAsValidator checks if the KRMInput configuration has the validator annotation set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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