action

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package action implements deploy, delete, list, and status business logic.

Each operation loads a spec and delegates to Helm or Kubernetes through small interfaces so commands stay thin and tests can inject fakes.

Operations

  • Deploy: install or upgrade a Helm release for an environment
  • Delete: remove deployed resources from a cluster
  • List: enumerate Helm releases and project components
  • Status: report rollout health for a release

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delete

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

Delete encapsulates the delete business logic.

func NewDelete

func NewDelete(deleter ReleaseDeleter) *Delete

NewDelete constructs a Delete with the given release deleter.

func (*Delete) Check

func (d *Delete) Check(ctx context.Context, params DeleteParams) (*DeleteResult, error)

Check verifies the release exists and returns it. Does not perform deletion.

func (*Delete) Execute

func (d *Delete) Execute(ctx context.Context, project, environment string, wait bool) error

Execute performs the actual deletion.

type DeleteParams

type DeleteParams struct {
	// Project is the Deployah project name.
	Project string
	// Environment is the target environment name.
	Environment string
	// Yes skips the not-found check and proceeds with deletion.
	Yes bool
	// DryRun previews deletion without mutating the cluster.
	DryRun bool
	// Wait blocks until all Kubernetes resources are fully removed.
	Wait bool
}

DeleteParams holds the parameters for a delete operation.

type DeleteResult

type DeleteResult struct {
	// Release is the Helm release when one was found.
	Release *v1.Release
	// NotFound is true when no release exists for the project and environment.
	NotFound bool
}

DeleteResult contains the outcome of a delete check.

type Deploy

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

Deploy encapsulates the deploy business logic.

func NewDeploy

func NewDeploy(deployer Deployer, loader SpecLoader) *Deploy

NewDeploy constructs a Deploy with the given deployer and loader.

func (*Deploy) Run

func (d *Deploy) Run(ctx context.Context, environment string, dryRun bool) (*spec.Spec, error)

Run loads the spec and installs or upgrades the Helm release.

type Deployer

type Deployer interface {
	InstallApp(ctx context.Context, m *spec.Spec, environment string, dryRun bool, resolved *spec.ResolvedSpec, postRenderer postrenderer.PostRenderer) error
}

Deployer abstracts Helm install/upgrade operations.

type List

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

List encapsulates the list business logic.

func NewList

func NewList(lister ReleaseLister) *List

NewList constructs a List with the given release lister.

func (*List) Run

func (l *List) Run(ctx context.Context, params ListParams) ([]*v1.Release, error)

Run returns non-nil releases matching the filters. Returns an empty slice (not an error) if none found.

type ListParams

type ListParams struct {
	// Project limits results to one Deployah project.
	Project string
	// Environment limits results to one environment.
	Environment string
}

ListParams holds the filter parameters for listing releases.

type ReleaseDeleter

type ReleaseDeleter interface {
	GetRelease(ctx context.Context, project, environment string) (*v1.Release, error)
	DeleteRelease(ctx context.Context, project, environment string, wait bool) error
}

ReleaseDeleter abstracts Helm get/delete operations.

type ReleaseGetter

type ReleaseGetter interface {
	ListReleases(ctx context.Context, selector labels.Selector) ([]*v1.Release, error)
}

ReleaseGetter lists Helm releases that match a label selector.

type ReleaseLister

type ReleaseLister interface {
	ListReleases(ctx context.Context, selector labels.Selector) ([]*v1.Release, error)
}

ReleaseLister abstracts Helm list operations.

type SpecLoader added in v0.3.0

type SpecLoader interface {
	Spec(ctx context.Context, environment string) (*spec.Spec, error)
}

SpecLoader loads and validates a spec for an environment.

type Status

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

Status encapsulates the status business logic.

func NewStatus

func NewStatus(getter ReleaseGetter) *Status

NewStatus constructs a Status with the given release getter.

func (*Status) Run

func (s *Status) Run(ctx context.Context, params StatusParams) ([]*v1.Release, error)

Run returns sorted releases for the given project. Returns an error if none found.

type StatusParams

type StatusParams struct {
	// Project is the Deployah project name.
	Project string
	// Environment limits status to one environment.
	Environment string
}

StatusParams holds the parameters for a status query.

Jump to

Keyboard shortcuts

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