helm

package
v0.14.6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditValuesCmd

func EditValuesCmd(helmClient Client, name, namespace string) tea.Cmd

EditValuesCmd returns a tea.Cmd that suspends the TUI, opens the release values in an editor, and performs helm upgrade on save.

func ReleaseToUnstructured

func ReleaseToUnstructured(r ReleaseInfo) *unstructured.Unstructured

ReleaseToUnstructured converts a ReleaseInfo to an unstructured object suitable for the plugin table view.

Types

type ChartResolver

type ChartResolver interface {
	Resolve(namespace, releaseName, version string) (*chart.Chart, error)
}

ChartResolver resolves a chart reference to a fully-loaded chart with dependencies. Returns (nil, nil) if no chart reference is configured (fallback to stored chart).

func NewConfigChartResolver

func NewConfigChartResolver(charts map[string]map[string]string) ChartResolver

NewConfigChartResolver creates a ChartResolver backed by the config's charts map. The map is read live — mutations via Config.SetChartRef are immediately visible.

type Client

type Client interface {
	ListReleases(namespace string) ([]ReleaseInfo, error)
	GetRelease(name, namespace string) (*ReleaseInfo, error)
	// GetValues returns the values for the named release in the given
	// namespace. When all is false, only user-supplied overrides are
	// returned (equivalent to `helm get values <release>`). When all is
	// true, the full coalesced set — chart defaults merged with user
	// overrides — is returned (equivalent to `helm get values <release>
	// --all`). The Helm SDK has no context-aware get-values action, so
	// timeout is applied at the transport level and each caller passes the
	// bound appropriate to its path: the values-edit loop passes
	// editor.ApplyTimeout (it runs on the tea.Exec-suspended path), while the
	// async detail fetch passes the user-configured api.timeout_seconds like
	// every other async fetch.
	GetValues(name, namespace string, all bool, timeout time.Duration) (map[string]any, error)
	History(name, namespace string) ([]RevisionInfo, error)
	// Upgrade re-applies the release's chart with the given values. ctx
	// bounds the apply itself: the only caller is the values-edit loop,
	// which runs while the TUI event loop is suspended (tea.Exec) and
	// passes an editor.ApplyTimeout deadline.
	Upgrade(ctx context.Context, name, namespace string, values map[string]any) error
	Rollback(name, namespace string, revision int) error
	Uninstall(name, namespace string) error
}

Client abstracts Helm operations for testability.

func NewClient

func NewClient(cfg *rest.Config, resolver ChartResolver) Client

NewClient creates a new Helm client backed by the Helm Go SDK.

type ReleaseInfo

type ReleaseInfo struct {
	Name       string
	Namespace  string
	Revision   int
	Chart      string
	AppVersion string
	Status     string
	Updated    time.Time
	Manifest   string
}

ReleaseInfo holds the fields ktui needs from a Helm release.

type RevisionInfo

type RevisionInfo struct {
	Revision    int
	Updated     time.Time
	Status      string
	Chart       string
	AppVersion  string
	Description string
}

RevisionInfo holds a single history entry.

Jump to

Keyboard shortcuts

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