shutdown

package
v0.60.0-rc1 Latest Latest
Warning

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

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

Documentation

Overview

Package shutdown implements the `rad shutdown` command, which backs up all durable Radius state (PostgreSQL control-plane databases and Terraform state Secrets) for the current workspace to a state archive. It is the counterpart of `rad startup`.

The command does not delete clusters or uninstall Radius; cluster lifecycle is the caller's responsibility. This keeps the command usable in any context and independent of any particular workspace kind.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(factory framework.Factory) (*cobra.Command, framework.Runner)

NewCommand creates an instance of the `rad shutdown` command and runner.

Types

type Runner

type Runner struct {
	ConfigHolder *framework.ConfigHolder
	Output       output.Interface
	Workspace    *workspaces.Workspace
	StateClient  StateBackupClient

	// Archive is the durable state archive that state is committed to. Tests inject a mock.
	Archive statearchive.Archive
}

Runner is the runner implementation for the `rad shutdown` command.

func NewRunner

func NewRunner(factory framework.Factory) *Runner

NewRunner creates a new Runner for the `rad shutdown` command.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

Run backs up the control-plane and Terraform state, then commits and pushes it.

func (*Runner) Validate

func (r *Runner) Validate(cmd *cobra.Command, args []string) error

Validate resolves the workspace and ensures it targets a Kubernetes cluster.

type StateBackupClient

type StateBackupClient interface {
	// BackupDatabases dumps the control-plane PostgreSQL databases into stateDir.
	BackupDatabases(ctx context.Context, kubeContext, namespace, stateDir string) error

	// BackupTerraform exports the Terraform state Secrets into stateDir.
	BackupTerraform(ctx context.Context, kubeContext, namespace, stateDir string) error
}

StateBackupClient backs up the durable Radius state for a Kubernetes context. It wraps the pgbackup and tfstate packages so the command can be unit tested without a cluster.

func NewStateBackupClient

func NewStateBackupClient() StateBackupClient

NewStateBackupClient returns the production StateBackupClient.

Jump to

Keyboard shortcuts

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