Documentation
¶
Overview ¶
Package jvm contains the jsonnet rendering logic.
Index ¶
- func JsonnetRender(cmdFlagsJsonnet types.CmdJsonnetOptions, filename string, ...)
- func JsonnetRenderClusterParams(vmconfig types.VMConfig, clusterName string, componentNames []string, ...) string
- func JsonnetRenderClusterParamsOnly(vmconfig types.VMConfig, clusterName string, clusterParams string, prune bool) string
- func JsonnetRenderFiles(vmConfig types.VMConfig, files []string, param string, prune bool, ...) string
- func JsonnetVM(vmconfig types.VMConfig) (*jsonnet.VM, error)
- func NativeHelmTemplate() *jsonnet.NativeFunction
- func NativeKompose() *jsonnet.NativeFunction
- func NativeRegexEscape() *jsonnet.NativeFunction
- func NativeRegexMatch() *jsonnet.NativeFunction
- func NativeRegexSubst() *jsonnet.NativeFunction
- func NativeSprigTemplate() *jsonnet.NativeFunction
- func RegisterNativeFuncs(jvm *jsonnet.VM)
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 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 ¶
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.