Documentation
¶
Overview ¶
Package generate implements the logic for generating output files based on input data.
Combines a directory of cluster configurations with a directory of components (along with some Jsonnet libs) to generate output files.
The package prepares a Jsonnet VM and loads the necessary libraries and extvars. A new VM is created for each component.
Index ¶
- func CheckIfUpdateNeeded(outFile string, outStr string) (bool, error)
- func CleanOutputDir(outputFileMap map[string]bool, componentOutputDir string) error
- func GenProcessCluster(clusterName string, clusterdir string, baseDir string, ...) error
- func GenProcessComponent(vmconfig types.VMConfig, componentName string, ...) error
- func GenerateIncludesFiles(includesFiles []kr8_types.Kr8ComponentSpecIncludeObject, ...) (map[string]bool, error)
- func GetClusterParams(clusterDir string, vmConfig types.VMConfig) (map[string]string, error)
- func ProcessFile(inputFile string, outputFile string, kr8Spec kr8_types.Kr8ClusterSpec, ...) (string, error)
- func SetupAndConfigureVM(vmconfig types.VMConfig, config string, kr8Spec kr8_types.Kr8ClusterSpec, ...) (*jsonnet.VM, string, error)
- func SetupJvmForComponent(vmconfig types.VMConfig, config string, kr8Spec kr8_types.Kr8ClusterSpec, ...) (*jsonnet.VM, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfUpdateNeeded ¶
Check if a file needs updating based on its current contents and the new contents.
func CleanOutputDir ¶
func GenProcessCluster ¶
func GenProcessComponent ¶
func GenerateIncludesFiles ¶
func GetClusterParams ¶
func ProcessFile ¶
func ProcessFile( inputFile string, outputFile string, kr8Spec kr8_types.Kr8ClusterSpec, componentName string, config string, incInfo kr8_types.Kr8ComponentSpecIncludeObject, jvm *jsonnet.VM, ) (string, error)
Process an includes file. Based on the extension, the file is processed differently.
- .jsonnet: Imported and processed using jsonnet VM.
- .yml, .yaml: Imported and processed through native function ParseYaml.
- .tpl, .tmpl: Processed using component config and Sprig templating.
func SetupAndConfigureVM ¶
func SetupJvmForComponent ¶
func SetupJvmForComponent( vmconfig types.VMConfig, config string, kr8Spec kr8_types.Kr8ClusterSpec, componentName string, ) (*jsonnet.VM, error)
This function sets up the JVM for a given component. It registers native functions, sets up post-processing, and prunes parameters as required. It's faster to create this VM for each component, rather than re-use. Default postprocessor just copies input to output.
Types ¶
This section is empty.