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 ¶
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.
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.
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.
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
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.
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.