Documentation
¶
Index ¶
- func ActionConfigV3(log *zap.Logger, kubeCfg *rest.Config, ns string) (*actionV3.Configuration, error)
- func AsRelease(rel relapi.Releaser) (*release.Release, error)
- func ChartPathOptions(repository, chart, version string) (*action.ChartPathOptions, string, error)
- func ChartValues(values []string, helmSet []plantypes.HelmValue, override string) (map[string]interface{}, error)
- func CheckResourceAccess(ctx context.Context, kubeCfg *rest.Config, resources []Resource, ...) error
- func Client(log *zap.Logger, kubeCfg *rest.Config, ns string) (*action.Configuration, error)
- func ClientV2(log *zap.Logger, kubeCfg *rest.Config, ns string) (*action.Configuration, error)
- func ConfigureDefaultInstall(client *action.Install) *action.Install
- func ConfigureDefaultRollback(client *action.Rollback) *action.Rollback
- func ConfigureDefaultUpgrade(client *action.Upgrade) *action.Upgrade
- func ConfirmUninstalled(cfg *action.Configuration, name string, uninstallErr error) error
- func DefaultInstall(actionCfg *action.Configuration) *action.Install
- func DefaultRollback(actionCfg *action.Configuration) *action.Rollback
- func DefaultUpgrade(actionCfg *action.Configuration) *action.Upgrade
- func GetChart(name string, cpo *action.ChartPathOptions, settings *cli.EnvSettings) (*chart.Chart, string, error)
- func GetChartByPath(urlOrPath string) (*chart.Chart, error)
- func GetManifest(cfg *action.Configuration, name string) (any, error)
- func GetRelease(cfg *action.Configuration, name string) (*release.Release, error)
- func HelmInstallWithLogStreaming(ctx context.Context, client *action.Install, chart *chart.Chart, ...) (*release.Release, error)
- func HelmUpgradeWithLogStreaming(ctx context.Context, client *action.Upgrade, releaseName string, ...) (*release.Release, error)
- func History(cfg *action.Configuration, name string) ([]*release.Release, error)
- func IsPending(rel *release.Release) bool
- func IsReleaseNotFound(err error) bool
- func LastGoodRevision(history []*release.Release) (int, bool)
- func LoadEnvSettings() (*cli.EnvSettings, error)
- func Logger(l *zap.Logger) func(string, ...interface{})
- func NewLogger(debugEnabled DebugEnabledFunc) *slog.Logger
- func RenderManifest(ch *chart.Chart, values map[string]interface{}, releaseName, namespace string) (string, error)
- func ResolveChartName(repository, name string) (string, string, error)
- func Rollback(actionCfg *action.Configuration, name string, revision int, ...) error
- func ShouldUpgrade(rel *release.Release) bool
- func TemplateChart(chart *chart.Chart, values map[string]interface{}) (string, error)
- func UpgradeValues(cfg *action.Configuration, last *release.Release, ...) (map[string]interface{}, error)
- func ValidateSchemaResources(ch *chart.Chart, values map[string]interface{}) error
- type DebugCheckHandler
- type DebugEnabledFunc
- type LiveOutputs
- type LogStreamer
- type Resource
- type RestClientGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionConfigV3 ¶
func AsRelease ¶ added in v0.19.1243
AsRelease unwraps a Helm 4.1 action result into the v1 release the rest of the runner reads. Helm returns the same value as an empty interface.
func ChartPathOptions ¶
func ChartPathOptions(repository, chart, version string) (*action.ChartPathOptions, string, error)
func ChartValues ¶
func CheckResourceAccess ¶ added in v0.19.1243
func CheckResourceAccess(ctx context.Context, kubeCfg *rest.Config, resources []Resource, releaseNamespace string, l *zap.Logger) error
CheckResourceAccess lists each rendered kind in the namespace the chart will use. A forbidden response fails the deploy before Helm mutates the cluster. A missing namespace or a CRD that is not installed yet is skipped: Helm creates those as part of the release.
func ClientV2 ¶
ClientV2 initializes a new Helm client with the given logger and kube config. NOTE: it doesn't initialise the release store.
func ConfigureDefaultInstall ¶
useful in case we want to configure a client that has already been created NOTE(fd): these default values were yoinked from the runner install code
func ConfigureDefaultRollback ¶ added in v0.19.1126
func ConfirmUninstalled ¶ added in v0.19.1178
func ConfirmUninstalled(cfg *action.Configuration, name string, uninstallErr error) error
ConfirmUninstalled resolves a failed uninstall against the release store and returns nil only when the release is genuinely gone.
Helm reports "release: not found" both when there was nothing to remove and when a real uninstall got partway through and then failed to purge the release record — a 404 from the storage backend on the record it had just served. The first is success, the second is not, and the error alone cannot tell them apart. Re-reading the release can: if it is still stored, the uninstall did not finish. Anything that is not a not-found error is returned untouched.
func DefaultInstall ¶
func DefaultInstall(actionCfg *action.Configuration) *action.Install
func DefaultRollback ¶ added in v0.19.1126
func DefaultRollback(actionCfg *action.Configuration) *action.Rollback
func DefaultUpgrade ¶
func DefaultUpgrade(actionCfg *action.Configuration) *action.Upgrade
func GetChart ¶
func GetChart(name string, cpo *action.ChartPathOptions, settings *cli.EnvSettings) (*chart.Chart, string, error)
func GetManifest ¶
func GetManifest(cfg *action.Configuration, name string) (any, error)
func GetRelease ¶
func History ¶ added in v0.19.1126
History returns every stored revision of a release, oldest first. A release that was never stored yields an empty history rather than an error, matching GetRelease's treatment of the same condition.
func IsPending ¶ added in v0.19.1126
IsPending reports whether a release is parked mid-operation, which helm refuses every further operation on until it is recovered.
func IsReleaseNotFound ¶ added in v0.19.1178
IsReleaseNotFound reports whether err means no such release is stored.
Both forms have to be handled. Helm's own errors keep the sentinel in the chain — including through the joined errors a partially failed uninstall returns — but several paths format it with %s or %v instead of %w, leaving only the message behind.
func LastGoodRevision ¶ added in v0.19.1126
LastGoodRevision returns the highest revision that finished a rollout. Failed revisions are excluded: returning to one trades a stuck release for a broken one. False means nothing to roll back to, as on a first install.
func LoadEnvSettings ¶
func LoadEnvSettings() (*cli.EnvSettings, error)
func NewLogger ¶
func NewLogger(debugEnabled DebugEnabledFunc) *slog.Logger
NewLogger creates a new logger with dynamic debug checking
func RenderManifest ¶ added in v0.19.1243
func RenderManifest(ch *chart.Chart, values map[string]interface{}, releaseName, namespace string) (string, error)
RenderManifest renders a chart on the client, using the release name and namespace Helm will install into. It does not contact the cluster.
func ResolveChartName ¶
resolveChartName returns the proper repository and name values that the ChartPathOptions need. This is copied from Terraform.
func Rollback ¶ added in v0.19.1126
func Rollback(actionCfg *action.Configuration, name string, revision int, timeout time.Duration) error
Rollback returns the release to revision, which must still exist in history. Needs no chart on disk: the SDK rebuilds it from the stored revision.
func ShouldUpgrade ¶ added in v0.19.850
ShouldUpgrade returns true when a release exists in a state that warrants an upgrade rather than a fresh install. This includes deployed releases as well as failed releases — Helm's upgrade action natively handles upgrading over a failed release.
func TemplateChart ¶ added in v0.19.783
func UpgradeValues ¶ added in v0.19.1277
func UpgradeValues(cfg *action.Configuration, last *release.Release, values map[string]interface{}) (map[string]interface{}, error)
UpgradeValues resolves Helm's default empty-input fallback before schema confinement. Run the upgrade with ResetValues so it uses this same selection.
func ValidateSchemaResources ¶ added in v0.19.1277
Helm's schema compiler can read host files and fetch URLs. Before entering it, compile the same active schemas with no external resource loader. Successful compilation proves their references (including metaschemas and rebased IDs) are self-contained; Helm still performs its normal values validation afterward.
Types ¶
type DebugCheckHandler ¶
type DebugCheckHandler struct {
// contains filtered or unexported fields
}
DebugCheckHandler checks settings.Debug at log time
type DebugEnabledFunc ¶
type DebugEnabledFunc func() bool
DebugEnabledFunc is a function type that determines if debug logging is enabled We use a function because we want to check the setting at log time, not when the logger is created
type LiveOutputs ¶ added in v0.19.1243
type LiveOutputs struct {
Ingresses map[string]interface{}
Services map[string]interface{}
Deployments map[string]interface{}
}
LiveOutputs are the deployments, services, and ingresses from a rendered chart, fetched by name after apply. The map shape matches the historical helm release outputs: namespace, then name, then the object with spec cleared.
func CollectLiveOutputs ¶ added in v0.19.1243
func CollectLiveOutputs(ctx context.Context, kubeCfg *rest.Config, resources []Resource, releaseNamespace string, l *zap.Logger) (LiveOutputs, error)
CollectLiveOutputs gets only the deployments, services, and ingresses named in resources. Kinds the chart did not render are not requested.
type LogStreamer ¶
type LogStreamer struct {
// contains filtered or unexported fields
}
func NewLogStreamer ¶
func NewLogStreamer(clientset *kubernetes.Clientset, l *zap.Logger) *LogStreamer
func (*LogStreamer) StopAllStreams ¶
func (ls *LogStreamer) StopAllStreams()
func (*LogStreamer) StopStream ¶
func (ls *LogStreamer) StopStream(podIdentifier string)
func (*LogStreamer) StreamPodLogs ¶
this is the entrypoint
func (*LogStreamer) Wait ¶
func (ls *LogStreamer) Wait()
type Resource ¶ added in v0.19.1243
Resource is one object from a rendered Helm manifest. An empty Namespace means the manifest did not set one. Callers that know the kind is namespaced should use the release namespace instead.
func ResourcesFromManifest ¶ added in v0.19.1243
ResourcesFromManifest reads objects out of a multi-document Helm manifest.
type RestClientGetter ¶
type RestClientGetter struct {
Namespace string
RestConfig *rest.Config
Clientset kubernetes.Interface
}
RestClientGetter is a RESTClientGetter interface implementation for the Helm Go packages.
func (*RestClientGetter) ToDiscoveryClient ¶
func (k *RestClientGetter) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
ToDiscoveryClient implemented interface method
func (*RestClientGetter) ToRESTConfig ¶
func (k *RestClientGetter) ToRESTConfig() (*rest.Config, error)
ToRESTConfig implemented interface method
func (*RestClientGetter) ToRESTMapper ¶
func (k *RestClientGetter) ToRESTMapper() (meta.RESTMapper, error)
ToRESTMapper implemented interface method
func (*RestClientGetter) ToRawKubeConfigLoader ¶
func (k *RestClientGetter) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader implemented interface method
Source Files
¶
- access.go
- action_install.go
- action_rollback.go
- action_upgrade.go
- chart.go
- client.go
- client_wrapper.go
- helm.go
- live_outputs.go
- log.go
- logger.go
- logstreamer.go
- manifest.go
- monitor.go
- release.go
- resources.go
- scoped_waiter.go
- settings.go
- slog_zap_bridge.go
- streaming_common.go
- streaming_install.go
- streaming_upgrade.go
- template.go
- template_schema.go
- uninstall.go
- values.go