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) GetReleaseLabel(ctx context.Context, namespace, releaseName, key 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) Render(ctx context.Context, namespace, releaseName string, opts InstallOptions) (out string, err error)
- type InstallOptions
- type Option
- type Options
- type RenderedResource
Constants ¶
const ( // ReleaseLabelPackageChecksum stores the rendered-manifests checksum on the release storage secret. ReleaseLabelPackageChecksum = "packageChecksum" // ReleaseLabelModuleChecksum stores the module checksum on the release storage secret. ReleaseLabelModuleChecksum = "moduleChecksum" // ReleaseLabelMaintenance marks a release whose resources must not be reconciled. // The value is "true" while the package is under maintenance, "false" otherwise. // It doubles as a resource label key (with an empty value) so the deckhouse // admission policy stops guarding those resources against manual edits. ReleaseLabelMaintenance = "maintenance.deckhouse.io/no-resource-reconciliation" )
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 ¶
func (c *Client) Delete(ctx context.Context, namespace, releaseName string, onTrackingEvent func(name string, report progrep.ProgressReport)) (err error)
Delete uninstalls a nelm release Returns nil if the release doesn't exist (idempotent)
onTrackingEvent is an optional callback invoked with progress updates as Kubernetes resources are being deleted.
func (*Client) GetChecksum ¶
GetChecksum retrieves the module checksum for a release It checks the storage label "packageChecksum"
func (*Client) GetReleaseLabel ¶ added in v1.77.0
func (c *Client) GetReleaseLabel(ctx context.Context, namespace, releaseName, key string) (string, error)
GetReleaseLabel returns the value of a storage label on the latest release. Returns ErrReleaseNotFound (wrapped) if the release doesn't exist and ErrLabelNotFound if the label is absent.
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
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
// RenderPatches are jq patches nelm applies to the rendered resources. Render
// and Install must get the same ones, or the checksum is taken over manifests
// the release does not apply.
RenderPatches []spec.Patch
TrackingOptions common.TrackingOptions
// 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 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 RenderedResource ¶ added in v1.78.0
type RenderedResource struct {
Unstruct *unstructured.Unstructured
// Regular reports a regular release resource: one that lives in the cluster
// for as long as the release does.
Regular bool
}
RenderedResource is one resource a chart render produced, carrying the classification nelm gave it.