render

package
v0.0.0-...-b4e5a94 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Template rendering

The operator will render all files in a directory that end with ".json" or ".yaml". The files will be passed through the Go templating engine.

The aim is to mimic the parsing behavior of kubectl create -f <dir> as much as reasonably possible.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDir

func RenderDir(manifestDir string, d *RenderData) ([]*unstructured.Unstructured, error)

RenderDir will render all manifests in a directory, descending in to subdirectories It will perform template substitutions based on the data supplied by the RenderData

func RenderTemplate

func RenderTemplate(path string, d *RenderData) ([]*unstructured.Unstructured, error)

RenderTemplate reads, renders, and attempts to parse a yaml or json file representing one or more k8s api objects

Types

type RenderData

type RenderData struct {
	Funcs  template.FuncMap
	Config *operv1.RenderConfig
}

RenderData holds the render data to be configured

func MakeRenderData

func MakeRenderData(c *operv1.RenderConfig) RenderData

MakeRenderData initializes render data structure

Jump to

Keyboard shortcuts

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