helm

package
v0.0.0-...-b705c5c Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Template

func Template(ctx context.Context, config TemplateConfig) (string, error)

Template will runhelm template in the provided chart and values without the need of the Helm binary and without executing an external command.

Types

type Chart

type Chart struct {
	// contains filtered or unexported fields
}

Chart represents a loaded Helm chart.

func LoadChart

func LoadChart(ctx context.Context, f fs.FS) (*Chart, error)

LoadChart loads a chart from a fs.FS system. There chart files must be at the root of the provided fs.FS. e.g: ./Chart.yaml, ./values.yaml ./templates/deployment.yaml...

You can use `fs.Sub` as a helper tool to get the root chart.

type TemplateConfig

type TemplateConfig struct {
	// ReleaseName is the name of the release.
	ReleaseName string
	// Chart is the loaded chart. Use `LoadChart`.
	Chart *Chart
	// Values are the custom values to be used on the chart template..
	Values map[string]interface{}
	// IncludeCRDs when enabled will template/render the CRDs.
	IncludeCRDs bool
	// Namespace is the namespace used to render the chart.
	Namespace string
	// ShowFiles is a list of files that can be used to only template the provided files,
	// by default it will render all.
	// This can be handy on specific use cases like unit tests for charts.
	ShowFiles []string
}

TemplateConfig is the configuration for Helm Template rendering.

Jump to

Keyboard shortcuts

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