Documentation
¶
Index ¶
- Constants
- Variables
- func BinVer(ctx context.Context) (semver.Version, error)
- func ChartSource(r latest.HelmRelease) string
- func ConstructOverrideArgs(r *latest.HelmRelease, builds []graph.Artifact, args []string, ...) ([]string, error)
- func CreateNamespaceErr(version string) error
- func Exec(ctx context.Context, h Client, out io.Writer, useSecrets bool, env []string, ...) error
- func ExecWithStdoutAndStderr(ctx context.Context, h Client, stdout io.Writer, stderr io.Writer, ...) error
- func GetArgs(releaseName string, namespace string) []string
- func MinVersionErr(minVer string) error
- func PluginErr(prefix string, err error) error
- func PreparePostRenderer(ctx context.Context, h Client, skaffoldBinary string, ...) (func(), []string, error)
- func PrepareSkaffoldFilter(h Client, builds []graph.Artifact, flags []string) (skaffoldBinary string, env []string, cleanup func(), err error)
- func ReleaseNamespace(namespace string, release latest.HelmRelease) (string, error)
- func SanitizeFilePath(s string, isWindowsOS bool) string
- func UserErr(prefix string, err error) error
- func VersionGetErr(err error) error
- type Client
Constants ¶
const PostRendererTemplate = `` /* 136-byte string literal not displayed */
Variables ¶
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 )
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 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 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 MinVersionErr ¶
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 ReleaseNamespace ¶
func ReleaseNamespace(namespace string, release latest.HelmRelease) (string, error)
func SanitizeFilePath ¶
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