helm

package
v2.11.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

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

	// WriteBuildArtifacts is meant to be reassigned for testing
	WriteBuildArtifacts = writeBuildArtifacts
)

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