nelm

package
v1.76.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ReleaseLabelPackageChecksum stores the rendered-manifests checksum on the release storage secret.
	ReleaseLabelPackageChecksum = "packageChecksum"
)

Variables

View Source
var (
	// ErrReleaseNotFound is returned when a nelm release doesn't exist
	ErrReleaseNotFound = errors.New("release not found")
	// ErrLabelNotFound is returned when a requested label is not present in the release
	ErrLabelNotFound = errors.New("label not found")
)

Functions

This section is empty.

Types

type Client

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

Client is a wrapper around nelm operations that provides a simplified interface

func New

func New(logger *log.Logger, opts ...Option) *Client

New creates a new nelm client. It initializes the nelm logger and applies any provided options.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, namespace, releaseName string) (err error)

Delete uninstalls a nelm release Returns nil if the release doesn't exist (idempotent)

func (*Client) GetChecksum

func (c *Client) GetChecksum(ctx context.Context, namespace, releaseName string) (string, error)

GetChecksum retrieves the module checksum for a release It checks the storage label "packageChecksum"

func (*Client) Install

func (c *Client) Install(ctx context.Context, namespace, releaseName string, opts InstallOptions) (err error)

Install installs a Helm chart as a release

func (*Client) LastStatus

func (c *Client) LastStatus(ctx context.Context, namespace, releaseName string) (string, string, error)

LastStatus returns the revision number and status of the latest release Returns ("0", "", nil) if the release doesn't exist

func (*Client) ListReleases added in v1.76.1

func (c *Client) ListReleases(ctx context.Context, opts ListOptions) ([]ReleaseRef, error)

ListReleases returns nelm releases cluster-wide matching opts.Selector. The filter is applied client-side — action.ReleaseList has no server-side selector.

func (*Client) Render

func (c *Client) Render(ctx context.Context, namespace, releaseName string, opts InstallOptions) (out string, err error)

Render renders a nelm chart to YAML manifests without installing it Returns the rendered manifests as a YAML string

type InstallOptions

type InstallOptions struct {
	Path        string   // Path to the chart directory
	ValuesPaths []string // Paths to values files
	RootValues  string   // Values in JSON format

	ReleaseLabels map[string]string // Labels to apply to the release

	ResourcesLabels map[string]string // Labels to apply to all resources

	// OnTrackingEvent is an optional callback invoked with progress updates
	// as Kubernetes resources are being tracked for readiness during install.
	OnTrackingEvent func(name string, report progrep.ProgressReport)
}

InstallOptions contains options for installing a Helm chart

type ListOptions added in v1.76.1

type ListOptions struct {
	// Selector filters releases by Release.Info annotations; all key/value
	// pairs must match. Empty selector matches every release.
	Selector map[string]string
}

ListOptions contains options for listing Helm releases.

type Option

type Option func(*Options)

Option is a functional option for configuring the nelm client

func WithHistoryMax

func WithHistoryMax(historyMax int32) Option

WithHistoryMax sets the maximum number of release revisions to keep in history

func WithReleaseAnnotations added in v1.76.1

func WithReleaseAnnotations(annotations map[string]string) Option

WithReleaseAnnotations sets annotations stamped on Release.Info.

func WithResourcesAnnotations added in v1.76.1

func WithResourcesAnnotations(annotations map[string]string) Option

WithResourcesAnnotations sets annotations stamped on every chart-rendered resource.

func WithResourcesLabels added in v1.76.1

func WithResourcesLabels(labels map[string]string) Option

WithResourcesLabels sets labels stamped on every chart-rendered resource.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the timeout duration for nelm operations

type Options

type Options struct {
	// HistoryMax defines the maximum number of release revisions to keep
	HistoryMax int32
	// Timeout for Helm operations
	Timeout time.Duration

	// ResourcesLabels are stamped on every chart-rendered resource.
	ResourcesLabels map[string]string
	// ResourcesAnnotations are stamped on every chart-rendered resource.
	ResourcesAnnotations map[string]string

	// ReleaseAnnotations are stamped on Release.Info (visible via action.ReleaseList).
	ReleaseAnnotations map[string]string
}

Options contains configuration for the nelm client

type ReleaseRef added in v1.76.1

type ReleaseRef struct {
	Namespace string
	Name      string
}

ReleaseRef identifies a nelm release (a logical install, not a specific revision).

Jump to

Keyboard shortcuts

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