Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Delete(ctx context.Context, namespace, releaseName string) (err error)
- func (c *Client) GetChecksum(ctx context.Context, namespace, releaseName string) (string, error)
- func (c *Client) Install(ctx context.Context, namespace, releaseName string, opts InstallOptions) (err error)
- func (c *Client) LastStatus(ctx context.Context, namespace, releaseName string) (string, string, error)
- func (c *Client) ListReleases(ctx context.Context, opts ListOptions) ([]ReleaseRef, error)
- func (c *Client) Render(ctx context.Context, namespace, releaseName string, opts InstallOptions) (out string, err error)
- type InstallOptions
- type ListOptions
- type Option
- type Options
- type ReleaseRef
Constants ¶
const (
// ReleaseLabelPackageChecksum stores the rendered-manifests checksum on the release storage secret.
ReleaseLabelPackageChecksum = "packageChecksum"
)
Variables ¶
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 ¶
New creates a new nelm client. It initializes the nelm logger and applies any provided options.
func (*Client) Delete ¶
Delete uninstalls a nelm release Returns nil if the release doesn't exist (idempotent)
func (*Client) GetChecksum ¶
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.
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 ¶
WithHistoryMax sets the maximum number of release revisions to keep in history
func WithReleaseAnnotations ¶ added in v1.76.1
WithReleaseAnnotations sets annotations stamped on Release.Info.
func WithResourcesAnnotations ¶ added in v1.76.1
WithResourcesAnnotations sets annotations stamped on every chart-rendered resource.
func WithResourcesLabels ¶ added in v1.76.1
WithResourcesLabels sets labels stamped on every chart-rendered resource.
func WithTimeout ¶
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
ReleaseRef identifies a nelm release (a logical install, not a specific revision).