nelm

package
v1.75.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionReasonRender           status.ConditionReason = "RenderFailed"
	ConditionReasonCheckChart       status.ConditionReason = "CheckChart"
	ConditionReasonCreateValuesFile status.ConditionReason = "CreateValuesFile"
	ConditionReasonCheckRelease     status.ConditionReason = "CheckRelease"
	ConditionReasonInstallChart     status.ConditionReason = "InstallChart"
)

Variables

View Source
var ErrPackageNotHelm = errors.New("package not helm")

Functions

This section is empty.

Types

type Package

type Package interface {
	GetName() string
	GetPath() string
	GetValues() addonutils.Values
	GetExtraNelmValues() string
}

Package provides access to package data needed for Helm operations.

type Service

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

Service manages Helm release lifecycle via nelm client. It provides upgrade, deletion, and rendering operations.

func NewService

func NewService(cache runtimecache.Cache, absentCallback monitor.AbsentCallback, logger *log.Logger) *Service

NewService creates a new nelm service for managing Helm releases.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, namespace, name string) error

Delete uninstalls a Helm release by name. This removes all resources created by the release from the cluster.

Returns error if the release doesn't exist or deletion fails.

func (*Service) HasMonitor

func (s *Service) HasMonitor(name string) bool

func (*Service) PauseMonitor

func (s *Service) PauseMonitor(name string)

func (*Service) RemoveMonitor

func (s *Service) RemoveMonitor(name string)

func (*Service) Render

func (s *Service) Render(ctx context.Context, namespace string, pkg Package) (string, error)

Render renders a Helm chart with the provided values and returns the manifests. This is useful for validating charts or previewing what will be installed.

Process:

  1. Verify the path contains a valid Helm chart
  2. Create temporary values file
  3. Render chart using nelm client
  4. Return rendered YAML manifests

Returns ErrPackageNotHelm if the path doesn't contain a valid Helm chart.

func (*Service) ResumeMonitor

func (s *Service) ResumeMonitor(name string)

func (*Service) StopMonitors

func (s *Service) StopMonitors()

func (*Service) Upgrade

func (s *Service) Upgrade(ctx context.Context, namespace string, pkg Package) error

Upgrade installs or upgrades a Helm release for a package.

Smart upgrade logic:

  • Renders chart and calculates manifest checksum
  • Checks if upgrade is needed (new install, status, checksum, missing resources)
  • Skips upgrade if nothing changed (optimization)
  • Starts resource monitoring after successful install/upgrade

Process:

  1. Verify package contains a Helm chart
  2. Create temporary values file from package values
  3. Render chart to get manifests
  4. Calculate manifest checksum
  5. Check if upgrade is needed
  6. Install/upgrade release if needed
  7. Start or verify resource monitoring

Returns ErrPackageNotHelm if the package doesn't contain a valid Helm chart.

Directories

Path Synopsis
Package monitor provides resource monitoring for Helm releases deployed via nelm.
Package monitor provides resource monitoring for Helm releases deployed via nelm.

Jump to

Keyboard shortcuts

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