Documentation
¶
Index ¶
- Variables
- type Service
- func (s *Service) Delete(ctx context.Context, app *apps.Application) error
- func (s *Service) HasMonitor(name string) bool
- func (s *Service) PauseMonitor(name string)
- func (s *Service) RemoveMonitor(name string)
- func (s *Service) Render(ctx context.Context, app *apps.Application) (string, error)
- func (s *Service) ResumeMonitor(name string)
- func (s *Service) StopMonitors()
- func (s *Service) Upgrade(ctx context.Context, app *apps.Application) error
Constants ¶
This section is empty.
Variables ¶
var ErrPackageNotHelm = errors.New("package not helm")
Functions ¶
This section is empty.
Types ¶
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 ¶
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 (*Service) PauseMonitor ¶
func (*Service) RemoveMonitor ¶
func (*Service) Render ¶
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:
- Verify the path contains a valid Helm chart
- Create temporary values file
- Render chart using nelm client
- Return rendered YAML manifests
Returns ErrPackageNotHelm if the path doesn't contain a valid Helm chart.
func (*Service) ResumeMonitor ¶
func (*Service) StopMonitors ¶
func (s *Service) StopMonitors()
func (*Service) Upgrade ¶
Upgrade installs or upgrades a Helm release for an application.
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:
- Verify package contains a Helm chart
- Create temporary values file from app values
- Render chart to get manifests
- Calculate manifest checksum
- Check if upgrade is needed
- Install/upgrade release if needed
- Start or verify resource monitoring
Returns ErrPackageNotHelm if the package doesn't contain a valid Helm chart.