helm

package
v2.18.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 31 Imported by: 2

Documentation

Index

Constants

View Source
const PostRendererTemplate = `` /* 136-byte string literal not displayed */

Variables

View Source
var (
	// VersionRegex extracts version from "helm version", for instance: "v3.19.0"
	VersionRegex = regexp.MustCompile(`v?(\d[\w.\-]+)`)

	// OSExecutable allows for replacing the skaffold binary for testing purposes
	OSExecutable = os.Executable

	// PluginInstallDir allows for replacing the `helm plugin install ...` directory for testing purposes
	PluginInstallDir = ""

	// WriteBuildArtifacts is meant to be reassigned for testing
	WriteBuildArtifacts = writeBuildArtifacts
)
View Source
var Helm4PostRendererVersion = semver.MustParse("4.0.0-beta.1")

Helm4PostRendererVersion represents the version cut-off for Helm v4's introduction of post-renderer plugins, not supporting `--post-renderer <executable>` anymore

Functions

func BinVer

func BinVer(ctx context.Context) (semver.Version, error)

BinVer returns the version of the helm binary found in PATH.

func ChartSource

func ChartSource(r latest.HelmRelease) string

func ConstructOverrideArgs

func ConstructOverrideArgs(r *latest.HelmRelease, builds []graph.Artifact, args []string, manifestOverrides map[string]string) ([]string, error)

ConstructOverrideArgs creates the command line arguments for overrides

func CreateNamespaceErr

func CreateNamespaceErr(version string) error

func Exec

func Exec(ctx context.Context, h Client, out io.Writer, useSecrets bool, env []string, args ...string) error

Exec executes the helm command, writing combined stdout/stderr to the provided writer

func ExecWithStdoutAndStderr

func ExecWithStdoutAndStderr(ctx context.Context, h Client, stdout io.Writer, stderr io.Writer, useSecrets bool, env []string, args ...string) error

ExecWithStdoutAndStderr executes the helm command, writing combined stdout and stderr to the provided writers

func GetArgs

func GetArgs(releaseName string, namespace string) []string

GetArgs calculates the correct arguments to "helm get"

func MinVersionErr

func MinVersionErr(minVer string) error

func PluginErr added in v2.17.0

func PluginErr(prefix string, err error) error

func PreparePostRenderer added in v2.17.0

func PreparePostRenderer(ctx context.Context, h Client, skaffoldBinary string, helmVersion semver.Version) (func(), []string, error)

PreparePostRenderer conditionally installs a post renderer plugin (starting from Helm v4) and returns an optional cleanup function in that case, plus in any case the needed command line arguments

func PrepareSkaffoldFilter

func PrepareSkaffoldFilter(h Client, builds []graph.Artifact, flags []string) (skaffoldBinary string, env []string, cleanup func(), err error)

func ReleaseNamespace

func ReleaseNamespace(namespace string, release latest.HelmRelease) (string, error)

func SanitizeFilePath

func SanitizeFilePath(s string, isWindowsOS bool) string

SanitizeFilePath is used to sanitize filepaths that are provided to the `setFiles` flag helm `setFiles` doesn't work with the unescaped filepath separator (\) for Windows or if there are unescaped tabs and spaces in the directory names. So we escape all odd count occurrences of `\` for Windows, and wrap the entire string in quotes if it has spaces. This is very specific to the way helm handles its flags. See https://github.com/helm/helm/blob/d55c53df4e394fb62b0514a09c57bce235dd7877/pkg/cli/values/options. Otherwise the windows `syscall` package implements its own sanitizing for command args that's used by `exec.Cmd`. See https://github.com/golang/go/blob/6951da56b0ae2cd4250fc1b0350d090aed633ac1/src/syscall/exec_windows.go#L27

func UserErr

func UserErr(prefix string, err error) error

func VersionGetErr

func VersionGetErr(err error) error

Types

type Client

type Client interface {
	EnableDebug() bool
	OverrideProtocols() []string
	ConfigFile() string
	KubeConfig() string
	KubeContext() string
	Labels() map[string]string
	GlobalFlags() []string
	ManifestOverrides() map[string]string
}

Jump to

Keyboard shortcuts

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