helmexec

package
v0.163.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHelmVersion added in v0.148.0

func GetHelmVersion(helmBinary string, runner Runner) (*semver.Version, error)

func GetPluginVersion added in v0.146.0

func GetPluginVersion(name, pluginsDir string) (*semver.Version, error)

func Indent

func Indent(text, indent string) string

indents a block of text with an indent string

func LiveOutput added in v0.146.0

func LiveOutput(ctx context.Context, c *exec.Cmd, stripArgsValuesOnExitError bool, stdout io.Writer) ([]byte, error)

func New

func New(helmBinary string, options HelmExecOptions, logger *zap.SugaredLogger, kubeconfig string, kubeContext string, runner Runner) *execer

New for running helm commands

func NewLogger

func NewLogger(writer io.Writer, logLevel string) *zap.SugaredLogger

func Output

func Output(ctx context.Context, c *exec.Cmd, stripArgsValuesOnExitError bool, logWriterGenerators ...*logWriterGenerator) ([]byte, error)

Types

type DependencyUpdater

type DependencyUpdater interface {
	UpdateDeps(chart string) error
	IsHelm3() bool
}

type ExitError

type ExitError struct {
	Message string
	Code    int
}

ExitError is created whenever your shell command exits with a non-zero exit status

func (ExitError) Error

func (e ExitError) Error() string

func (ExitError) ExitStatus

func (e ExitError) ExitStatus() int

type HelmContext

type HelmContext struct {
	HistoryMax  int
	WorkerIndex int
	Writer      io.Writer
}

type HelmExecOptions added in v0.153.0

type HelmExecOptions struct {
	EnableLiveOutput   bool
	DisableForceUpdate bool
}

type Interface

type Interface interface {
	SetExtraArgs(args ...string)
	SetHelmBinary(bin string)
	SetEnableLiveOutput(enableLiveOutput bool)
	SetDisableForceUpdate(forceUpdate bool)

	AddRepo(name, repository, cafile, certfile, keyfile, username, password string, managed string, passCredentials, skipTLSVerify bool) error
	UpdateRepo() error
	RegistryLogin(name, username, password, caFile, certFile, keyFile string, skipTLSVerify bool) error
	BuildDeps(name, chart string, flags ...string) error
	UpdateDeps(chart string) error
	SyncRelease(context HelmContext, name, chart string, flags ...string) error
	DiffRelease(context HelmContext, name, chart string, suppressDiff bool, flags ...string) error
	TemplateRelease(name, chart string, flags ...string) error
	Fetch(chart string, flags ...string) error
	ChartPull(chart string, path string, flags ...string) error
	ChartExport(chart string, path string) error
	Lint(name, chart string, flags ...string) error
	ReleaseStatus(context HelmContext, name string, flags ...string) error
	DeleteRelease(context HelmContext, name string, flags ...string) error
	TestRelease(context HelmContext, name string, flags ...string) error
	List(context HelmContext, filter string, flags ...string) (string, error)
	DecryptSecret(context HelmContext, name string, flags ...string) (string, error)
	IsHelm3() bool
	GetVersion() Version
	IsVersionAtLeast(versionStr string) bool
	ShowChart(chart string) (chart.Metadata, error)
}

Interface for executing helm commands

type Runner

type Runner interface {
	Execute(cmd string, args []string, env map[string]string, enableLiveOutput bool) ([]byte, error)
	ExecuteStdIn(cmd string, args []string, env map[string]string, stdin io.Reader) ([]byte, error)
}

Runner interface for shell commands

type ShellRunner

type ShellRunner struct {
	Dir string

	StripArgsValuesOnExitError bool

	Logger *zap.SugaredLogger
	Ctx    context.Context
}

ShellRunner implemention for shell commands

func (ShellRunner) Execute

func (shell ShellRunner) Execute(cmd string, args []string, env map[string]string, enableLiveOutput bool) ([]byte, error)

Execute a shell command

func (ShellRunner) ExecuteStdIn

func (shell ShellRunner) ExecuteStdIn(cmd string, args []string, env map[string]string, stdin io.Reader) ([]byte, error)

Execute a shell command

type Version

type Version struct {
	Major int
	Minor int
	Patch int
}

Version represents the version of helm

Jump to

Keyboard shortcuts

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