render

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 11 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 Dir

func Dir(manifestDir string, d *Data) ([]*unstructured.Unstructured, error)

Dir 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 Template

func Template(path string, d *Data) ([]*unstructured.Unstructured, error)

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

Types

type Config

type Config struct {
	PullSecret string
}

type Data

type Data struct {
	Funcs template.FuncMap
	Data  map[string]interface{}
}

func MakeRenderData

func MakeRenderData() Data

type DeviceInfo

type DeviceInfo struct {
	PciAddress string
	NumVfs     int
}

Jump to

Keyboard shortcuts

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