Documentation
¶
Index ¶
- Constants
- Variables
- func NewChartCacheError(err error) error
- func NewDuplicateError(uniq uniqname.UniqName) error
- func NewHelmTestsError(err error) error
- func NewInvalidNamespaceError(namespace string) error
- func NewInvalidServerSideApplyError(v string) error
- func NewInvalidWaitStrategyError(strategy string) error
- func NewPostRendererError(binary, output string, err error) error
- func NewPostRendererNotFoundError(binary string, err error) error
- func NewUnexpectedReleaseTypeError(rel any) error
- func NewYAMLDecodeDependsOnError(dependsOn string, err error) error
- func ProhibitDst(values []ValuesReference) error
- type Chart
- type ChartCacheError
- type Config
- type Configs
- type DependencyType
- type DependsOnReference
- type DuplicateError
- type HelmActionRunner
- type HelmTestsError
- type InvalidNamespaceError
- type InvalidServerSideApplyError
- type InvalidWaitStrategyError
- type MonitorFailedAction
- type MonitorReference
- type PendingStrategy
- type PostRendererError
- type PostRendererNotFoundError
- type UnexpectedReleaseTypeError
- type ValuesReference
- func (v *ValuesReference) Download(ctx context.Context) error
- func (v ValuesReference) JSONSchema() *jsonschema.Schema
- func (v *ValuesReference) MarshalYAML() (any, error)
- func (v *ValuesReference) SetUniq(dir string, name uniqname.UniqName) *ValuesReference
- func (v *ValuesReference) SetViaRelease(ctx context.Context, rel Config, dir, templater string, ...) error
- func (v *ValuesReference) UnmarshalYAML(node *yaml.Node) error
- type WaitStrategy
- type YAMLDecodeDependsOnError
Constants ¶
const ( // WaitStrategyWatcher waits for every resource using kubernetes watches. This is what // `wait: true` means. WaitStrategyWatcher = WaitStrategy(kube.StatusWatcherStrategy) // WaitStrategyLegacy waits by polling, the way helm 3 did. WaitStrategyLegacy = WaitStrategy(kube.LegacyStrategy) // WaitStrategyHookOnly waits only for hooks, not for the chart's own resources. This is what // `wait: false` means, and the default when `wait` is not set at all. WaitStrategyHookOnly = WaitStrategy(kube.HookOnlyStrategy) )
Variables ¶
var ( ErrNameEmpty = errors.New("release name is empty") // ErrPendingRelease is an error for fail strategy that release is in pending status. ErrPendingRelease = errors.New("release is in pending status") // ErrValuesNotExist is returned when values can't be used and are skipped. ErrValuesNotExist = errors.New("values file doesn't exist") // ErrNotFound is an error for not found release. ErrNotFound = driver.ErrReleaseNotFound // ErrFoundMultiple is an error for multiple releases found by name. ErrFoundMultiple = errors.New("found multiple releases o_0") // ErrDepFailed is an error thrown when dependency release fails. ErrDepFailed = errors.New("dependency failed") ErrUnknownFormat = errors.New("unknown format") ErrDigestNotMatch = errors.New("chart digest doesn't match") )
var ErrNilRelease = errors.New("helm returned no release and no error")
ErrNilRelease is returned when helm hands back no release and no error. Callers dereference the result as soon as the error is nil, so a nil release has to be an error rather than a value.
Functions ¶
func NewChartCacheError ¶
func NewDuplicateError ¶
func NewHelmTestsError ¶
func NewInvalidServerSideApplyError ¶ added in v1.1.0
func NewPostRendererError ¶
func ProhibitDst ¶
func ProhibitDst(values []ValuesReference) error
ProhibitDst Dst now is public method. Dst needs to marshal for export. Also, dst needs to unmarshal for import from plan.
Types ¶
type Chart ¶
type Chart struct {
Name string `` /* 142-byte string literal not displayed */
CaFile string `yaml:"ca_file" json:"ca_file" jsonschema:"description=Verify certificates of HTTPS-enabled servers using this CA bundle"`
CertFile string `yaml:"cert_file" json:"cert_file" jsonschema:"description=Identify HTTPS client using this SSL certificate file"`
KeyFile string `yaml:"key_file" json:"key_file" jsonschema:"description=Identify HTTPS client using this SSL key file"`
Keyring string `yaml:"keyring" json:"keyring" jsonschema:"description=Location of public keys used for verification"`
RepoURL string `yaml:"repo_url" json:"repo_url" jsonschema:"description=Chart repository url"`
Username string `yaml:"username" json:"username" jsonschema:"description=Chart repository username"`
Password string `yaml:"password" json:"password" jsonschema:"description=Chart repository password"`
Version string `yaml:"version" json:"version" jsonschema:"description=Chart version"`
InsecureSkipTLSVerify bool `` /* 132-byte string literal not displayed */
Verify bool `yaml:"verify" json:"verify" jsonschema:"description=Verify the provenance of the chart before using it"`
PassCredentialsAll bool `yaml:"pass_credentials" json:"pass_credentials" jsonschema:"description=Pass credentials to all domains"`
PlainHTTP bool `yaml:"plain_http" json:"plain_http" jsonschema:"description=Connect to server with plain http and not https,default=false"`
SkipDependencyUpdate bool `` /* 141-byte string literal not displayed */
SkipRefresh bool `` /* 127-byte string literal not displayed */
}
Chart is a structure for chart download options.
func (*Chart) CopyOptions ¶
func (c *Chart) CopyOptions(cpo *action.ChartPathOptions)
CopyOptions is a helper for copy options from Chart to ChartPathOptions.
type ChartCacheError ¶
type ChartCacheError struct {
Err error
}
func (ChartCacheError) Error ¶
func (err ChartCacheError) Error() string
func (ChartCacheError) Unwrap ¶
func (err ChartCacheError) Unwrap() error
type Config ¶
type Config interface {
log.LoggerGetter
HelmActionRunner
Uniq() uniqname.UniqName
AllowFailure() bool
DryRun(dryRun bool)
HideSecret(hideSecret bool)
ChartDepsUpd() error
DownloadChart(tmpDir string) error
BuildValues(ctx context.Context, dir, templater string) error
Name() string
Namespace() string
Chart() *Chart
SetChartName(string)
DependsOn() []*DependsOnReference
SetDependsOn(deps []*DependsOnReference)
Tags() []string
Repo() string
Values() []ValuesReference
HelmWait() bool
KubeContext() string
Cfg() *action.Configuration
HooksDisabled() bool
OfflineKubeVersion() *common.KubeVersion
Validate() error
Monitors() []MonitorReference
NotifyMonitorsFailed(ctx context.Context, monitors ...monitor.Config)
Lifecycle() hooks.Lifecycle
}
Config is an interface to manage particular helm release.
type Configs ¶
type Configs []Config
Configs type of array Config.
func (Configs) JSONSchema ¶
func (Configs) JSONSchema() *jsonschema.Schema
type DependencyType ¶
type DependencyType int
const ( DependencyRelease DependencyType = iota DependencyTag DependencyInvalid )
type DependsOnReference ¶
type DependsOnReference struct {
Name string `` /* 135-byte string literal not displayed */
Tag string `` /* 153-byte string literal not displayed */
Optional bool `` /* 127-byte string literal not displayed */
}
DependsOnReference is used to store release dependencies.
func (*DependsOnReference) Type ¶
func (d *DependsOnReference) Type() DependencyType
func (*DependsOnReference) Uniq ¶
func (d *DependsOnReference) Uniq() uniqname.UniqName
func (*DependsOnReference) UnmarshalYAML ¶
func (d *DependsOnReference) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML is used to implement InterfaceUnmarshaler interface of gopkg.in/yaml.v3.
type DuplicateError ¶
func (DuplicateError) Error ¶
func (err DuplicateError) Error() string
type HelmActionRunner ¶
type HelmActionRunner interface {
SyncDryRun(ctx context.Context, runHooks bool) (*release.Release, error)
Sync(ctx context.Context, runHooks bool) (*release.Release, error)
Uninstall(ctx context.Context) (*releaseiface.UninstallReleaseResponse, error)
Get(version int) (*release.Release, error)
List() (*release.Release, error)
Rollback(ctx context.Context, version int) error
Status() (*release.Release, error)
}
type HelmTestsError ¶
type HelmTestsError struct {
Err error
}
func (HelmTestsError) Error ¶
func (err HelmTestsError) Error() string
func (HelmTestsError) Unwrap ¶
func (err HelmTestsError) Unwrap() error
type InvalidNamespaceError ¶
type InvalidNamespaceError struct {
Namespace string
}
func (InvalidNamespaceError) Error ¶
func (err InvalidNamespaceError) Error() string
type InvalidServerSideApplyError ¶ added in v1.1.0
type InvalidServerSideApplyError struct {
Value string
}
InvalidServerSideApplyError is returned when server_side_apply is not one of "", "true", "false" or "auto".
func (InvalidServerSideApplyError) Error ¶ added in v1.1.0
func (e InvalidServerSideApplyError) Error() string
type InvalidWaitStrategyError ¶
type InvalidWaitStrategyError struct {
Strategy string
}
func (InvalidWaitStrategyError) Error ¶
func (err InvalidWaitStrategyError) Error() string
type MonitorFailedAction ¶
type MonitorFailedAction string
MonitorFailedAction is a type for enumerating actions for handling failed monitors.
const ( MonitorActionNone MonitorFailedAction = "" MonitorActionRollback MonitorFailedAction = "rollback" MonitorActionUninstall MonitorFailedAction = "uninstall" )
func SelectMonitorFailedAction ¶ added in v1.3.0
func SelectMonitorFailedAction(refs []MonitorReference, failed ...monitor.Config) MonitorFailedAction
SelectMonitorFailedAction deterministically selects a single remediation action for a release from its monitor references, given the set of failed monitors. When the failed monitors map to different actions the safest one wins (see monitorActionPriority). The result does not depend on the order of refs or failed.
func (MonitorFailedAction) JSONSchema ¶
func (MonitorFailedAction) JSONSchema() *jsonschema.Schema
type MonitorReference ¶
type MonitorReference struct {
Name string `yaml:"name" json:"name" jsonschema:"required"`
Action MonitorFailedAction `yaml:"action" json:"action" jsonschema:"title=Action if monitor fails"`
}
type PendingStrategy ¶
type PendingStrategy string
PendingStrategy is a type for enumerating strategies for handling pending releases.
const ( // PendingStrategyRollback rolls back pending release. PendingStrategyRollback PendingStrategy = "rollback" // PendingStrategyUninstall uninstalls pending release. PendingStrategyUninstall PendingStrategy = "uninstall" )
func (PendingStrategy) JSONSchema ¶
func (PendingStrategy) JSONSchema() *jsonschema.Schema
type PostRendererError ¶
func (PostRendererError) Error ¶
func (err PostRendererError) Error() string
func (PostRendererError) Unwrap ¶
func (err PostRendererError) Unwrap() error
type PostRendererNotFoundError ¶
func (PostRendererNotFoundError) Error ¶
func (err PostRendererNotFoundError) Error() string
func (PostRendererNotFoundError) Unwrap ¶
func (err PostRendererNotFoundError) Unwrap() error
type UnexpectedReleaseTypeError ¶
type UnexpectedReleaseTypeError struct {
Release any
}
func (UnexpectedReleaseTypeError) Error ¶
func (err UnexpectedReleaseTypeError) Error() string
type ValuesReference ¶
type ValuesReference struct {
Src string `yaml:"src" json:"src" jsonschema:"required,description=Source of values. Can be local path or HTTP URL"`
Dst string `yaml:"dst" json:"dst" jsonschema:"readOnly"`
DelimiterLeft string `` /* 127-byte string literal not displayed */
DelimiterRight string `` /* 129-byte string literal not displayed */
Renderer string `yaml:"renderer" json:"renderer" jsonschema:"description=How to render the file,enum=sprig,enum=gomplate,enum=copy,enum=sops"`
Strict bool `yaml:"strict" json:"strict" jsonschema:"description=Whether to fail if values is not found,default=false"`
}
ValuesReference is used to match source values file path and temporary.
func (*ValuesReference) Download ¶
func (v *ValuesReference) Download(ctx context.Context) error
Download downloads values by source URL and places to destination path.
func (ValuesReference) JSONSchema ¶
func (v ValuesReference) JSONSchema() *jsonschema.Schema
func (*ValuesReference) MarshalYAML ¶
func (v *ValuesReference) MarshalYAML() (any, error)
MarshalYAML is used to implement Marshaler interface of gopkg.in/yaml.v3.
func (*ValuesReference) SetUniq ¶
func (v *ValuesReference) SetUniq(dir string, name uniqname.UniqName) *ValuesReference
SetUniq generates unique file path based on provided base directory, release uniqname and sha1 of source path.
func (*ValuesReference) SetViaRelease ¶
func (v *ValuesReference) SetViaRelease( ctx context.Context, rel Config, dir, templater string, renderedFiles *renderedValuesFiles, ) error
SetViaRelease downloads and templates values file. Returns ErrValuesNotExist if values can't be downloaded or doesn't exist in local FS.
func (*ValuesReference) UnmarshalYAML ¶
func (v *ValuesReference) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML flexible config.
type WaitStrategy ¶
type WaitStrategy string
WaitStrategy tells helm how to wait for the resources of a release.
helm v3 took a boolean, helm v4 replaced it with a named strategy. `wait: true` and `wait: false` are still accepted and mapped the same way helm maps its own deprecated boolean --wait.
func (WaitStrategy) Enabled ¶
func (s WaitStrategy) Enabled() bool
Enabled reports whether the release waits for its own resources, and not just for its hooks.
func (WaitStrategy) Helm ¶
func (s WaitStrategy) Helm() kube.WaitStrategy
Helm returns the helm wait strategy. helm has no usable zero value here — it refuses to build a waiter for an empty strategy — so an unset strategy becomes the same default helm's own CLI uses.
func (WaitStrategy) JSONSchema ¶
func (WaitStrategy) JSONSchema() *jsonschema.Schema
func (*WaitStrategy) UnmarshalYAML ¶
func (s *WaitStrategy) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML is an unmarshaller for gopkg.in/yaml.v3 that accepts both the helm 3 boolean and the helm 4 strategy name.
func (WaitStrategy) Validate ¶
func (s WaitStrategy) Validate() error
Validate checks that the strategy is one helm knows.
type YAMLDecodeDependsOnError ¶
func (YAMLDecodeDependsOnError) Error ¶
func (err YAMLDecodeDependsOnError) Error() string
func (YAMLDecodeDependsOnError) Unwrap ¶
func (err YAMLDecodeDependsOnError) Unwrap() error