jnetvm

package
v0.0.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package jvm contains the jsonnet rendering logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonnetRender

func JsonnetRender(cmdFlagsJsonnet types.CmdJsonnetOptions, filename string, vmConfig types.VMConfig)

Renders a jsonnet file with the specified options.

func JsonnetRenderClusterParams

func JsonnetRenderClusterParams(
	vmconfig types.VMConfig,
	clusterName string,
	componentNames []string,
	clusterParams string,
	prune bool,
) string

Render cluster params, merged with one or more component's parameters. Empty componentName list renders all component parameters.

func JsonnetRenderClusterParamsOnly

func JsonnetRenderClusterParamsOnly(
	vmconfig types.VMConfig,
	clusterName string,
	clusterParams string,
	prune bool,
) string

Only render cluster params (_cluster), without components.

func JsonnetRenderFiles

func JsonnetRenderFiles(
	vmConfig types.VMConfig,
	files []string,
	param string,
	prune bool,
	prepend string,
	source string,
) string

Takes a list of jsonnet files and imports each one. Formats the string for jsonnet using "+".

func JsonnetVM

func JsonnetVM(vmconfig types.VMConfig) (*jsonnet.VM, error)

Create a Jsonnet VM to run commands in.

func NativeHelmTemplate

func NativeHelmTemplate() *jsonnet.NativeFunction

Allows executing helm template to process a helm chart and make available to kr8 configuration.

Source: https://github.com/grafana/tanka/blob/v0.27.1/pkg/helm/template.go#L23

func NativeKompose

func NativeKompose() *jsonnet.NativeFunction

Allows converting a docker-compose file string into kubernetes resources using kompose. Files in the directory must be in the format `[docker-]compose.ym[a]l`.

Source: https://github.com/kubernetes/kompose/blob/main/cmd/convert.go

Inputs: `inFile`, `outPath`, `opts`.

func NativeRegexEscape

func NativeRegexEscape() *jsonnet.NativeFunction

Escapes a string for use in regex.

Inputs: "str".

func NativeRegexMatch

func NativeRegexMatch() *jsonnet.NativeFunction

Matches a string against a regex pattern.

Inputs: "regex", "string".

func NativeRegexSubst

func NativeRegexSubst() *jsonnet.NativeFunction

Substitutes a regex pattern in a string with another string.

Inputs: "regex", "src", "repl".

func NativeSprigTemplate

func NativeSprigTemplate() *jsonnet.NativeFunction

Uses sprig to process passed in config data and template. Sprig template guide: https://masterminds.github.io/sprig/ .

Inputs: "config" "str".

func RegisterNativeFuncs

func RegisterNativeFuncs(jvm *jsonnet.VM)

Registers additional native functions in the jsonnet VM. These functions are used to extend the functionality of jsonnet. Adds on to functions part of the jsonnet stdlib: https://jsonnet.org/ref/stdlib.html

Types

This section is empty.

Jump to

Keyboard shortcuts

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