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.
- Validates environment gate (prod requires --prod-i-mean-it).
- Detects idempotent state (already on target version → no-op).
- Prompts user unless --yes is set.
- Tags current state for post-mortem.
- Invokes deploy rollback to target version.
- 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.
Click to show internal directories.
Click to hide internal directories.