helmx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package helmx wraps the helm CLI: chart index queries, upgrades, and the release introspection that `flow cluster status` and `history` render.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartVersion

type ChartVersion struct {
	Name        string `json:"name"`
	Version     string `json:"version"`
	AppVersion  string `json:"app_version"`
	Description string `json:"description"`
}

ChartVersion is one row from `helm search repo --versions`.

type Helm

type Helm struct {
	Runner flowexec.Runner
	Bin    string
}

Helm wraps the helm binary.

func New

func New(r flowexec.Runner) *Helm

New returns a Helm for the helm binary.

func (*Helm) Available

func (h *Helm) Available() bool

Available reports whether helm is on PATH.

func (*Helm) GetValues

func (h *Helm) GetValues(ctx context.Context, release, namespace, kubeContext string) (string, error)

GetValues returns the values actually deployed for a release.

func (*Helm) HasVersion

func (h *Helm) HasVersion(ctx context.Context, repo, chart, version string) (bool, error)

HasVersion reports whether a specific version is present in the index.

func (*Helm) History

func (h *Helm) History(ctx context.Context, release, namespace, kubeContext string) ([]Revision, error)

History returns the release's revision history, newest last.

func (*Helm) ListRepos

func (h *Helm) ListRepos(ctx context.Context) ([]Repo, error)

ListRepos returns the configured chart repositories.

func (*Helm) Rollback

func (h *Helm) Rollback(ctx context.Context, release, namespace, kubeContext string, revision int) error

Rollback reverts a release to a previous revision. Revision 0 means the immediately previous one, which is helm's own default.

func (*Helm) SearchVersions

func (h *Helm) SearchVersions(ctx context.Context, repo, chart string) ([]ChartVersion, error)

SearchVersions lists every published version of a chart, including pre-releases: the alpha chart versions CI publishes are all pre-releases, so --devel is mandatory here.

func (*Helm) Status

func (h *Helm) Status(ctx context.Context, release, namespace, kubeContext string) (Release, error)

Status returns the deployed release's summary.

func (*Helm) Uninstall

func (h *Helm) Uninstall(ctx context.Context, release, namespace, kubeContext string, keepHistory bool) error

Uninstall removes a release.

func (*Helm) UpdateRepo

func (h *Helm) UpdateRepo(ctx context.Context, repo string) error

UpdateRepo refreshes one chart repository's index.

func (*Helm) Upgrade

func (h *Helm) Upgrade(ctx context.Context, o UpgradeOptions) error

Upgrade runs helm upgrade, streaming helm's output straight to the terminal so the user sees progress and errors as helm produces them.

func (*Helm) Version

func (h *Helm) Version(ctx context.Context) (string, error)

Version returns helm's version string.

type Release

type Release struct {
	Name         string    `json:"name"`
	Namespace    string    `json:"namespace"`
	Revision     int       `json:"revision"`
	Status       string    `json:"status"`
	LastDeployed time.Time `json:"last_deployed"`
	ChartVersion string    `json:"chart_version"`
	AppVersion   string    `json:"app_version"`
	Description  string    `json:"description"`
}

Release is the summary `helm status -o json` provides.

type Repo

type Repo struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

Repo is one entry from `helm repo list`.

type Revision

type Revision struct {
	Revision    int       `json:"revision"`
	Updated     time.Time `json:"updated"`
	Status      string    `json:"status"`
	Chart       string    `json:"chart"`
	AppVersion  string    `json:"app_version"`
	Description string    `json:"description"`
}

Revision is one row of `helm history`.

type UpgradeOptions

type UpgradeOptions struct {
	Release     string
	Chart       string
	Namespace   string
	Version     string
	KubeContext string
	ValuesFiles []string
	SetValues   []string
	ExtraArgs   []string
	Install     bool
	Wait        bool
	Atomic      bool
	CreateNS    bool
	Timeout     string
	DryRun      bool
}

UpgradeOptions describes a `helm upgrade` invocation.

func (UpgradeOptions) CommandLine

func (o UpgradeOptions) CommandLine(bin string) string

CommandLine renders the upgrade as a copy-pasteable shell command.

func (UpgradeOptions) UpgradeArgs

func (o UpgradeOptions) UpgradeArgs() []string

UpgradeArgs renders the full argv. It is exported so the command can print the exact invocation before running it — the printed line and the executed command can then never disagree.

Jump to

Keyboard shortcuts

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