helmdocs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BuiltInObjects = []HelmDocumentation{
		{"Values", ".Values", "The values made available through values.yaml, --set and -f."},
		{"Chart", ".Chart", "Chart metadata"},
		{"Subcharts", ".Subcharts", "Provides access to the scope (.Values, .Charts, .Releases, etc.) of subcharts to the parent. For example, .Subcharts.mySubChart.myValue to access the myValue in the mySubChart chart."},
		{"Files", ".Files.Get $str", "Access non-template files within the chart"},
		{"Capabilities", ".Capabilities.KubeVersion", "Access capabilities of Kubernetes"},
		{"Release", ".Release", `Built-in release values. Attributes include:
    - .Release.Name: Name of the release
    - .Release.Time: Time release was executed
    - .Release.Namespace: Namespace into which release will be placed (if not overridden)
    - .Release.Service: The service that produced this release. Usually Tiller.
    - .Release.IsUpgrade: True if this is an upgrade
    - .Release.IsInstall: True if this is an install
    - .Release.Revision: The revision number
    `},
		{"Template", ".Template", "Contains information about the current template that is being executed"},
	}
	BuiltinFuncs = []HelmDocumentation{
		{"template", "template $str $ctx", "Render the template at location $str"},
		{"define", "define $str", "Define a template with the name $str"},
		{"and", "and $a $b ...", "If $a then $b else $a"},
		{"call", "call $func $arg $arg2 ...", "Call a $func with all $arg(s)"},
		{"html", "html $str", "Escape $str for injection into HTML"},
		{"index", "index $collection $key $key2 ...", "Get item out of (nested) collection"},
		{"js", "js $str", "Encode $str for embedding in JavaScript"},
		{"len", "len $countable", "Get the length of a $countable object (list, string, etc.)"},
		{"not", "not $x", "Negate the boolean value of $x"},
		{"or", "or $a $b", "If $a then $a else $b"},
		{"print", "print $val", "Print value"},
		{"printf", "printf $format $val ...", "Print $format, injecting values. Follows Sprintf conventions."},
		{"println", "println $val", "Print $val followed by newline"},
		{"urlquery", "urlquery $val", "Escape value for injecting into a URL query string"},
		{"ne", "ne $a $b", "Returns true if $a != $b"},
		{"eq", "eq $a $b ...", "Returns true if $a == $b (== ...)"},
		{"lt", "lt $a $b", "Returns true if $a < $b"},
		{"gt", "gt $a $b", "Returns true if $a > $b"},
		{"le", "le $a $b", "Returns true if $a <= $b"},
		{"ge", "ge $a $b", "Returns true if $a >= $b"},
	}
	SprigFuncs = []HelmDocumentation{}/* 108 elements not displayed */

	HelmFuncs = []HelmDocumentation{
		{"include", "include $str $ctx", "(chainable) Include the named template with the given context."},
		{"toYaml", "toYaml $var", "Convert $var to YAML."},
		{"toJson", "toJson $var", "Convert $var to JSON."},
		{"toToml", "toToml $var", "Convert $var to TOML."},
		{"fromYaml", "fromYaml $str", "Parse YAML into a dict or list."},
		{"fromJson", "fromJson $str", "Parse JSON $str into a dict or list."},
		{"required", "required $str $val", "Fail template with message $str if $val is not provided or is empty."},
		{"tpl", "tpl $templateString $values", "Allows to evaluate strings as templates inside a template. This is useful to pass a template string as a value to a chart or render external configuration files."},
	}

	AllFuncs = slices.Concat(HelmFuncs, SprigFuncs, BuiltinFuncs)

	CapabilitiesVals = []HelmDocumentation{
		{"TillerVersion", ".Capabilities.TillerVersion", "Tiller version"},
		{"APIVersions", ".Capabilities.APIVersions", "A set of versions."},
		{"APIVersions.Has", "Capabilities.APIVersions.Has $version", "Indicates whether a version (e.g., batch/v1) or resource (e.g., apps/v1/Deployment) is available on the cluster."},
		{"KubeVersion", "Capabilities.KubeVersion", "The Kubernetes version."},
		{"KubeVersion.Version", "Capabilities.KubeVersion.Version", "The Kubernetes version in semver format."},
		{"KubeVersion.Major", "Capabilities.KubeVersion.Major", "The Kubernetes major version."},
		{"KubeVersion.Minor", "Capabilities.KubeVersion.Minor", "The Kubernetes minor version."},
		{"KubeVersion.GitCommit", "Capabilities.KubeVersion.GitCommit", "The kubernetes git sha1."},
		{"KubeVersion.GitVersion", "Capabilities.KubeVersion.GitVersion", "The kubernetes git version."},
		{"KubeVersion.GitTreeState", "Capabilities.KubeVersion.GitTreeState", "The state of the kubernetes git tree."},
		{"HelmVersion.GitCommit", "Capabilities.HelmVersion.GitCommit", "The Helm git sha1."},
		{"HelmVersion.GitTreeState", "Capabilities.HelmVersion.GitTreeState", "The state of the Helm git tree."},
		{"HelmVersion.GoVersion", "Capabilities.HelmVersion.GoVersion", "The version of the Go compiler used."},
	}

	ChartVals = []HelmDocumentation{
		{"Name", ".Chart.Name", "Name of the chart"},
		{"Version", ".Chart.Version", "Version of the chart"},
		{"Description", ".Chart.Description", "Chart description"},
		{"Keywords", ".Chart.Keywords", "A list of keywords (as strings)"},
		{"Home", ".Chart.Home", "The chart homepage URL"},
		{"Sources", ".Chart.Sources", "A list of chart download URLs"},
		{"Maintainers", ".Chart.Maintainers", "A list of maintainer objects"},
		{"Icon", ".Chart.Icon", "The URL to the chart's icon file"},
		{"AppVersion", ".Chart.AppVersion", "The version of the main app contained in this chart"},
		{"Deprecated", ".Chart.Deprecated", "If true, this chart is no longer maintained"},
		{"TillerVersion", ".Chart.TillerVersion", "The version (range) of Tiller that this chart can run on"},
		{"APIVersion", ".Chart.APIVersion", "The API version of this chart"},
		{"Condition", ".Chart.Condition", "The condition to check to enable the chart"},
		{"Tags", ".Chart.Tags", "The tags to check to enable the chart"},
		{"Annotations", ".Chart.Annotations", "Additional annotations (key-value pairs)"},
		{"KubeVersion", ".Chart.KubeVersion", "Kubernetes version required"},
		{"Dependencies", ".Chart.Dependencies", "List of chart dependencies"},
		{"Type", ".Chart.Type", "Chart type (application or library)"},
	}

	TemplateVals = []HelmDocumentation{
		{"Name", ".Template.Name", "A namespaced file path to the current template (e.g. mychart/templates/mytemplate.yaml)"},
		{"BasePath", ".Template.BasePath", "The namespaced path to the templates directory of the current chart (e.g. mychart/templates)."},
	}

	ReleaseVals = []HelmDocumentation{
		{"Name", ".Release.Name", "Name of the release"},
		{"Time", ".Release.Time", "Time of the release"},
		{"Namespace", ".Release.Namespace", "Default namespace of the release"},
		{"Service", ".Release.Service", "The service that is rendering the present template. On Helm, this is always Helm"},
		{"IsUpgrade", ".Release.IsUpgrade", "True if this is an upgrade operation"},
		{"IsInstall", ".Release.IsInstall", "True if this is an install operation"},
		{"Revision", ".Release.Revision", "Release revision number (starts at 1)"},
	}

	FilesVals = []HelmDocumentation{
		{"Get", ".Files.Get $path", "Get file contents. Path is relative to chart."},
		{"GetBytes", ".Files.GetBytes $path", "Get file contents as a byte array. Path is relative to chart."},
		{"Glob", ".Files.Glob $glob", "Returns a list of files whose names match the given shell glob pattern."},
		{"Lines", ".Files.Lines $path", "Reads a file line-by-line. This is useful for iterating over each line in a file."},
		{"AsSecrets", ".Files.AsSecrets $path", "Returns the file bodies as Base 64 encoded strings."},
		{"AsConfig", ".Files.AsConfig $path", "Returns file bodies as a YAML map."},
	}

	BuiltInOjectVals = map[string][]HelmDocumentation{
		"Chart":        ChartVals,
		"Release":      ReleaseVals,
		"Files":        FilesVals,
		"Capabilities": CapabilitiesVals,
		"Template":     TemplateVals,
	}
)

Functions

This section is empty.

Types

type HelmDocumentation

type HelmDocumentation struct {
	Name   string
	Detail string
	Doc    string
}

func GetFunctionByName

func GetFunctionByName(name string) (HelmDocumentation, bool)

Jump to

Keyboard shortcuts

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