app

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 36 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultHelmfile              = "helmfile.yaml"
	DefaultHelmfileDirectory     = "helmfile.d"
	ExperimentalSelectorExplicit = "explicit-selector-inheritance" // value to remove default selector inheritance to sub-helmfiles and use the explicit one
)
View Source
const (
	DefaultHelmBinary      = state.DefaultHelmBinary
	DefaultKustomizeBinary = state.DefaultKustomizeBinary
)
View Source
const (
	HelmRequiredVersion           = "v3.18.6"
	HelmDiffRecommendedVersion    = "v3.13.0"
	HelmRecommendedVersion        = "v3.19.0"
	HelmSecretsRecommendedVersion = "v4.6.5"
	HelmGitRecommendedVersion     = "v1.3.0"
	HelmS3RecommendedVersion      = "v0.16.3"
	HelmInstallCommand            = "https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3"
)

Variables

View Source
var (
	SetReverse = func(r bool) func(o *LoadOpts) {
		return func(o *LoadOpts) {
			o.Reverse = r
		}
	}

	SetRetainValuesFiles = func(r bool) func(o *LoadOpts) {
		return func(o *LoadOpts) {
			o.RetainValuesFiles = r
		}
	}

	SetFilter = func(f bool) func(o *LoadOpts) {
		return func(o *LoadOpts) {
			o.Filter = f
		}
	}
)
View Source
var CleanWaitGroup sync.WaitGroup

Functions

func AskForConfirmation added in v0.145.1

func AskForConfirmation(s string) bool

Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]

Shamelessly borrowed from @r0l1's awesome work that is available at https://gist.github.com/r0l1/3dcbb0c8f6cfe9c66ab8008f55f8f28b

func FormatAsJson added in v0.145.1

func FormatAsJson(releases []*HelmRelease) error

func FormatAsTable added in v0.145.1

func FormatAsTable(releases []*HelmRelease) error

func GetArgs added in v0.158.1

func GetArgs(args string, state *state.HelmState) []string

func ValidateConfig added in v0.145.1

func ValidateConfig(conf ApplyConfigProvider) error

ValidateConfig validates the given Helmfile config.

Types

type App

type App struct {
	OverrideKubeContext        string
	OverrideHelmBinary         string
	OverrideKustomizeBinary    string
	EnableLiveOutput           bool
	StripArgsValuesOnExitError bool
	DisableForceUpdate         bool

	Logger      *zap.SugaredLogger
	Kubeconfig  string
	Env         string
	Namespace   string
	Chart       string
	Selectors   []string
	Args        string
	ValuesFiles []string
	Set         map[string]any

	FileOrDir string
	// contains filtered or unexported fields
}

App is the main application object.

func Init

func Init(app *App) *App

func New added in v0.145.1

func New(conf ConfigProvider) *App

func (*App) Apply added in v0.145.1

func (a *App) Apply(c ApplyConfigProvider) error

func (*App) CleanCacheDir added in v0.145.1

func (a *App) CleanCacheDir(c CacheConfigProvider) error

func (*App) Deps added in v0.145.1

func (a *App) Deps(c DepsConfigProvider) error

func (*App) Destroy added in v0.145.1

func (a *App) Destroy(c DestroyConfigProvider) error

func (*App) Diff added in v0.145.1

func (a *App) Diff(c DiffConfigProvider) error

func (*App) Fetch added in v0.145.1

func (a *App) Fetch(c FetchConfigProvider) error

func (*App) ForEachState added in v0.145.1

func (a *App) ForEachState(do func(*Run) (bool, []error), includeTransitiveNeeds bool, o ...LoadOption) error

func (*App) Init added in v0.148.0

func (a *App) Init(c InitConfigProvider) error

func (*App) Lint added in v0.145.1

func (a *App) Lint(c LintConfigProvider) error

func (*App) ListReleases added in v0.145.1

func (a *App) ListReleases(c ListConfigProvider) error

func (*App) PrintDAGState added in v0.164.0

func (a *App) PrintDAGState(c DAGConfigProvider) error

func (*App) PrintState added in v0.145.1

func (a *App) PrintState(c StateConfigProvider) error

func (*App) Repos added in v0.145.1

func (a *App) Repos(c ReposConfigProvider) error

func (*App) ShowCacheDir added in v0.145.1

func (a *App) ShowCacheDir(c CacheConfigProvider) error

func (*App) Status added in v0.145.1

func (a *App) Status(c StatusesConfigProvider) error

func (*App) Sync added in v0.145.1

func (a *App) Sync(c SyncConfigProvider) error

func (*App) Template added in v0.145.1

func (a *App) Template(c TemplateConfigProvider) error

func (*App) Test added in v0.145.1

func (a *App) Test(c TestConfigProvider) error

func (*App) Wrap added in v0.145.1

func (a *App) Wrap(converge func(*state.HelmState, helmexec.Interface) []error) func(st *state.HelmState, helm helmexec.Interface, includeTransitiveNeeds bool) (bool, []error)

func (*App) WrapWithoutSelector added in v0.145.1

func (a *App) WrapWithoutSelector(converge func(*state.HelmState, helmexec.Interface) []error) func(st *state.HelmState, helm helmexec.Interface) (bool, []error)

func (*App) WriteValues added in v0.145.1

func (a *App) WriteValues(c WriteValuesConfigProvider) error

type ApplyConfigProvider added in v0.145.1

type ApplyConfigProvider interface {
	Args() string
	PostRenderer() string
	PostRendererArgs() []string
	SkipSchemaValidation() bool
	Cascade() string
	HideNotes() bool
	TakeOwnership() bool
	SuppressOutputLineRegex() []string

	Values() []string
	Set() []string
	SkipCRDs() bool
	SkipDeps() bool
	SkipRefresh() bool
	Wait() bool
	WaitRetries() int
	WaitForJobs() bool

	IncludeTests() bool

	Suppress() []string
	SuppressSecrets() bool
	ShowSecrets() bool
	NoHooks() bool
	SuppressDiff() bool

	DetailedExitcode() bool
	StripTrailingCR() bool

	Color() bool
	NoColor() bool
	Context() int
	DiffOutput() string

	Validate() bool
	SkipCleanup() bool
	SkipDiffOnInstall() bool

	DiffArgs() string
	SyncArgs() string

	SyncReleaseLabels() bool

	DAGConfig
	// contains filtered or unexported methods
}

type CacheConfigProvider added in v0.145.3

type CacheConfigProvider any

type ConfigProvider added in v0.145.1

type ConfigProvider interface {
	Args() string
	HelmBinary() string
	KustomizeBinary() string
	EnableLiveOutput() bool
	StripArgsValuesOnExitError() bool
	DisableForceUpdate() bool
	SkipDeps() bool
	SkipRefresh() bool

	FileOrDir() string
	KubeContext() string
	Namespace() string
	Chart() string
	Selectors() []string
	StateValuesSet() map[string]any
	StateValuesFiles() []string
	Kubeconfig() string
	Env() string
	// contains filtered or unexported methods
}

type Context

type Context struct {
	// contains filtered or unexported fields
}

func NewContext

func NewContext() Context

func (Context) SyncReposOnce

func (ctx Context) SyncReposOnce(st *state.HelmState, helm state.RepoUpdater) error

type DAGConfig added in v0.145.1

type DAGConfig interface {
	SkipNeeds() bool
	IncludeNeeds() bool
	IncludeTransitiveNeeds() bool
}

type DAGConfigProvider added in v0.164.0

type DAGConfigProvider any

type DepsConfigProvider added in v0.145.1

type DepsConfigProvider interface {
	Args() string
	SkipRepos() bool
	IncludeTransitiveNeeds() bool
	// contains filtered or unexported methods
}

type DestroyConfigProvider added in v0.145.1

type DestroyConfigProvider interface {
	Args() string
	Cascade() string

	SkipDeps() bool
	SkipRefresh() bool
	SkipCharts() bool
	DeleteWait() bool
	DeleteTimeout() int
	// contains filtered or unexported methods
}

type DiffConfigProvider added in v0.145.1

type DiffConfigProvider interface {
	Args() string
	PostRenderer() string
	PostRendererArgs() []string
	SkipSchemaValidation() bool
	SuppressOutputLineRegex() []string

	Values() []string
	Set() []string
	Validate() bool
	SkipCRDs() bool
	SkipDeps() bool
	SkipRefresh() bool

	IncludeTests() bool

	Suppress() []string
	SuppressSecrets() bool
	ShowSecrets() bool
	NoHooks() bool
	SuppressDiff() bool
	SkipDiffOnInstall() bool
	DiffArgs() string

	DAGConfig

	DetailedExitcode() bool
	StripTrailingCR() bool
	Color() bool
	NoColor() bool
	Context() int
	DiffOutput() string
	TakeOwnership() bool
	// contains filtered or unexported methods
}

type Error added in v0.145.1

type Error struct {
	Errors []error
	// contains filtered or unexported fields
}

Error is a wrapper around an error that adds context to the error.

func (*Error) Code added in v0.145.1

func (e *Error) Code() int

func (*Error) Error added in v0.145.1

func (e *Error) Error() string

type FetchConfigProvider added in v0.145.1

type FetchConfigProvider interface {
	SkipDeps() bool
	SkipRefresh() bool
	OutputDir() string
	OutputDirTemplate() string
	// contains filtered or unexported methods
}

type HelmRelease added in v0.145.1

type HelmRelease struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Enabled   bool   `json:"enabled"`
	Installed bool   `json:"installed"`
	Labels    string `json:"labels"`
	Chart     string `json:"chart"`
	Version   string `json:"version"`
}

type HelmfileInit added in v0.148.0

type HelmfileInit struct {
	// contains filtered or unexported fields
}

func NewHelmfileInit added in v0.148.0

func NewHelmfileInit(helmBinary string, c InitConfigProvider, logger *zap.SugaredLogger, runner helmexec.Runner) *HelmfileInit

func (*HelmfileInit) CheckHelm added in v0.148.0

func (h *HelmfileInit) CheckHelm() error

func (*HelmfileInit) CheckHelmPlugins added in v0.148.0

func (h *HelmfileInit) CheckHelmPlugins() error

func (*HelmfileInit) Initialize added in v0.148.0

func (h *HelmfileInit) Initialize() error

func (*HelmfileInit) InstallHelm added in v0.148.0

func (h *HelmfileInit) InstallHelm() error

func (*HelmfileInit) UpdateHelm added in v0.148.0

func (h *HelmfileInit) UpdateHelm() error

func (*HelmfileInit) WhetherContinue added in v0.148.0

func (h *HelmfileInit) WhetherContinue(ask string) error

type InitConfigProvider added in v0.148.0

type InitConfigProvider interface {
	Force() bool
}

type LintConfigProvider added in v0.145.1

type LintConfigProvider interface {
	Args() string

	Values() []string
	Set() []string
	SkipDeps() bool
	SkipRefresh() bool
	SkipCleanup() bool

	DAGConfig
	// contains filtered or unexported methods
}

type ListConfigProvider added in v0.145.1

type ListConfigProvider interface {
	Output() string
	SkipCharts() bool
}

type LoadOption added in v0.145.1

type LoadOption func(o *LoadOpts)

type LoadOpts added in v0.145.1

type LoadOpts struct {
	Selectors   []string
	Environment state.SubhelmfileEnvironmentSpec

	RetainValuesFiles bool

	// CalleePath is the absolute path to the file being loaded
	CalleePath string

	Reverse bool

	Filter bool
}

func (LoadOpts) DeepCopy added in v0.145.1

func (o LoadOpts) DeepCopy() LoadOpts

type MultiError added in v0.145.1

type MultiError struct {
	Errors []error
}

func (*MultiError) Error added in v0.145.1

func (e *MultiError) Error() string

type NoMatchingHelmfileError

type NoMatchingHelmfileError struct {
	// contains filtered or unexported fields
}

func (*NoMatchingHelmfileError) Error

func (e *NoMatchingHelmfileError) Error() string

type Opts added in v0.145.1

type Opts struct {
	DAGEnabled bool
}

type RenderOpts added in v0.145.1

type RenderOpts struct {
}

type ReposConfigProvider added in v0.145.1

type ReposConfigProvider interface {
	Args() string
	IncludeTransitiveNeeds() bool
}

type Run added in v0.145.1

type Run struct {
	ReleaseToChart map[state.PrepareChartKey]string

	Ask func(string) bool
	// contains filtered or unexported fields
}

func NewRun added in v0.145.1

func NewRun(st *state.HelmState, helm helmexec.Interface, ctx Context) (*Run, error)

func (*Run) Deps added in v0.145.1

func (r *Run) Deps(c DepsConfigProvider) []error

func (*Run) Repos added in v0.145.1

func (r *Run) Repos(c ReposConfigProvider) error

type StateConfigProvider added in v0.145.1

type StateConfigProvider interface {
	EmbedValues() bool
}

type StatusesConfigProvider added in v0.145.1

type StatusesConfigProvider interface {
	Args() string
	// contains filtered or unexported methods
}

type SyncConfigProvider added in v0.145.1

type SyncConfigProvider interface {
	Args() string
	PostRenderer() string
	SkipSchemaValidation() bool
	PostRendererArgs() []string
	HideNotes() bool
	TakeOwnership() bool
	Cascade() string

	Values() []string
	Set() []string
	SkipCRDs() bool
	SkipDeps() bool
	SkipRefresh() bool
	Wait() bool
	WaitRetries() int
	WaitForJobs() bool
	SyncArgs() string

	Validate() bool

	SkipNeeds() bool
	IncludeNeeds() bool
	IncludeTransitiveNeeds() bool

	SyncReleaseLabels() bool

	DAGConfig
	// contains filtered or unexported methods
}

type TemplateConfigProvider added in v0.145.1

type TemplateConfigProvider interface {
	Args() string
	PostRenderer() string
	PostRendererArgs() []string
	SkipSchemaValidation() bool

	Values() []string
	Set() []string
	OutputDirTemplate() string
	Validate() bool
	SkipDeps() bool
	SkipRefresh() bool
	SkipCleanup() bool
	SkipTests() bool
	OutputDir() string
	IncludeCRDs() bool
	NoHooks() bool
	KubeVersion() string
	ShowOnly() []string

	DAGConfig
	// contains filtered or unexported methods
}

type TestConfigProvider added in v0.145.1

type TestConfigProvider interface {
	Args() string

	SkipDeps() bool
	SkipRefresh() bool
	Timeout() int
	Cleanup() bool
	Logs() bool
	// contains filtered or unexported methods
}

type WriteValuesConfigProvider added in v0.145.1

type WriteValuesConfigProvider interface {
	Values() []string
	Set() []string
	OutputFileTemplate() string
	SkipDeps() bool
	SkipRefresh() bool
	SkipCleanup() bool
	IncludeTransitiveNeeds() bool
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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