jnetvm

import "github.com/ice-bergtech/kr8/pkg/jnetvm"

Package jvm contains the jsonnet rendering logic.

Index

func JsonnetRender

func JsonnetRender(cmdFlagsJsonnet types.CmdJsonnetOptions, filename string, vmConfig types.VMConfig, logger zerolog.Logger) error

Renders a jsonnet file with the specified options.

func JsonnetRenderClusterParams

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

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, error)

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, error)

Takes a list of jsonnet files and imports each one. Formats the string for jsonnet using "+". source is only used for error messages.

func JsonnetVM

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

Create a Jsonnet VM to run commands in. It:

  • creates a jsonnet VM
  • registers kr8+ native functions
  • Add jsonnet library directories
  • loads external files into extVars

func MergeComponentDefaults

func MergeComponentDefaults(componentMap map[string]kr8_types.Kr8ClusterComponentRef, componentNames []string, vmConfig types.VMConfig) (string, error)