releasectl

package
v0.0.1-dev.137 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package releasectl is the server-side executor for stateful runeset releases. It wires the pure planning/reconcile core (pkg/release) to the real cluster: the orchestrator for services and the store repos for secrets, configmaps and volumes. This is the body behind the future ReleaseService.Cast RPC (C1).

Design: _docs/plugins/RUNESET_STATEFUL_RELEASES.md, CAST_REFACTOR_PLAN.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller executes release specs against the cluster.

func NewController

func NewController(orch orchestrator.Orchestrator, st store.Store, logger log.Logger) *Controller

NewController builds a Controller from the orchestrator and store.

func (*Controller) Cast

Cast runs a full reconcile for the given spec + rendered payloads.

func (*Controller) Plan

func (c *Controller) Plan(ctx context.Context, spec release.ReleaseSpec) (*release.Plan, error)

Plan computes the 3-way reconcile plan for a spec WITHOUT applying it — the dry-run / diff path behind ReleaseService.Plan. It needs only the desired resource refs (not the rendered payloads), so callers can render-lite.

func (*Controller) Uninstall

func (c *Controller) Uninstall(ctx context.Context, namespace, name string, opts UninstallOptions) error

Uninstall removes the resources owned by a release in reverse dependency order (services → secrets → configmaps → volumes) via the existing prune path, then records the outcome.

Soft by default (Decision D4): on success the record is marked uninstalled and kept as a tombstone for history/reinstall. opts.Purge hard-deletes the record instead. Shared/referenced cluster kinds (StorageClass, Namespace) are never deleted (Decision D2) — only the Owns set is pruned.

TODO: honor reclaim policy and opts.KeepVolumes in the prune path (currently the applier's volume Prune deletes the record; retain → release is a deeper change tracked alongside the DeletionOperation reclaim work).

type Payloads

type Payloads struct {
	Services   map[string]*types.Service
	Secrets    map[string]*types.Secret
	Configmaps map[string]*types.Configmap
	Volumes    map[string]*types.Volume
}

Payloads carries the rendered resource objects for a cast, keyed by OwnerRef.Key(). The CLI renders the castfile set into these before calling Cast; the executor stamps ownership and applies them.

type UninstallOptions

type UninstallOptions struct {
	// KeepVolumes overrides reclaim policy to retain volume data on uninstall.
	KeepVolumes bool
	// Purge removes the release record entirely instead of soft-marking it
	// uninstalled (the default is a soft tombstone, Decision D4).
	Purge bool
}

UninstallOptions tune an uninstall (Decision D4).

Jump to

Keyboard shortcuts

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