soak

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package soak provides helpers for nself soak abort --rollback.

Index

Constants

This section is empty.

Variables

View Source
var ErrAbortCanceled = errors.New("soak abort canceled by user")

ErrAbortCanceled is returned when the user declines the confirmation prompt.

View Source
var ErrAlreadyRolledBack = errors.New("environment is already at the target version")

ErrAlreadyRolledBack is returned when the environment is already on the target version (idempotent no-op).

Functions

func Abort

func Abort(ctx context.Context, opts AbortOptions) error

Abort executes the soak-abort workflow.

  1. Validates environment gate (prod requires --prod-i-mean-it).
  2. Detects idempotent state (already on target version → no-op).
  3. Prompts user unless --yes is set.
  4. Tags current state for post-mortem.
  5. Invokes deploy rollback to target version.
  6. Posts a notify event.

Types

type AbortOptions

type AbortOptions struct {
	// Version to roll back to (required).
	Version string
	// DryRun prints rollback steps without executing them.
	DryRun bool
	// SkipConfirm is set by --yes; bypasses interactive prompt.
	SkipConfirm bool
	// AllowProd is set by --prod-i-mean-it; required to run against production.
	AllowProd bool
	// Env is the target environment: "local", "staging", or "prod"/"production".
	Env string
	// Stdout/Stderr for output (defaults to os.Stdout/os.Stderr if nil).
	Stdout io.Writer
	Stderr io.Writer
	// Stdin for user confirmation (defaults to os.Stdin if nil).
	Stdin io.Reader
}

AbortOptions holds the parsed flags for soak abort.

Jump to

Keyboard shortcuts

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