extcontainer

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseActionID = "com.steadybit.extension_container"
)

Variables

This section is empty.

Functions

func AddPrefix

func AddPrefix(containerId string, runtime types.Runtime) string

func NewContainerDiscovery

func NewContainerDiscovery(client types.Client) discovery_kit_sdk.TargetDiscovery

func NewFillMemoryContainerAction added in v1.3.22

func NewFillMemoryContainerAction(r ociruntime.OciRuntime, c types.Client) action_kit_sdk.Action[FillMemoryActionState]

func NewNetworkDNSErrorInjectionAction added in v1.6.0

func NewNetworkDNSErrorInjectionAction(r ociruntime.OciRuntime, client types.Client) action_kit_sdk.Action[DNSErrorInjectionState]

func NewNetworkTcpResetContainerAction added in v1.6.0

func NewNetworkTcpResetContainerAction(r ociruntime.OciRuntime, client types.Client) action_kit_sdk.Action[NetworkActionState]

func NewPauseContainerAction

func NewPauseContainerAction(client types.Client) action_kit_sdk.Action[PauseActionState]

func NewStopContainerAction

func NewStopContainerAction(client types.Client) action_kit_sdk.Action[StopActionState]

func RemovePrefix

func RemovePrefix(containerId string) string

Types

type ClaimResult added in v1.7.0

type ClaimResult int

ClaimResult is what claimNetnsForAttack tells Start to do.

const (
	// ClaimPrimary is the first (or freshest, after full release) claim on
	// this netns. Start applies the attack. Stop must release the counter
	// exactly once via NetnsClaimed=true on state.
	ClaimPrimary ClaimResult = iota
	// ClaimShadow means a sibling container already claimed this netns
	// with IDENTICAL opts. Start skips apply. Stop skips revert. Release
	// counter exactly once via NetnsClaimed=true.
	ClaimShadow
	// ClaimPassthrough means a sibling claimed this netns with DIFFERENT
	// opts. Start proceeds normally (Apply is called). Netfault then decides
	// whether to accept as compatible or reject as conflicting. Stop reverts
	// normally. Passthrough does NOT touch the counter — NetnsClaimed=false
	// on state so Stop won't try to release.
	ClaimPassthrough
)

type DNSErrorInjectionState added in v1.6.0

type DNSErrorInjectionState struct {
	ExecutionId string
	ContainerID string
}

type FillDiskActionState

type FillDiskActionState struct {
	ExecutionId     uuid.UUID
	ContainerID     string
	TargetLabel     string
	Sidecar         diskfill.SidecarOpts
	FillDiskOpts    diskfill.Opts
	IgnoreExitCodes []int
}

type FillMemoryActionState added in v1.3.22

type FillMemoryActionState struct {
	ExecutionId     uuid.UUID
	ContainerID     string
	TargetLabel     string
	TargetProcess   ociruntime.LinuxProcessInfo
	FillMemoryOpts  memfill.Opts
	IgnoreExitCodes []int
}

type Mode

type Mode string
const (
	ModeReadWriteAndFlush Mode = "read_write_and_flush"
	ModeReadWrite         Mode = "read_write"
	ModeFlush             Mode = "flush"
)

type NetworkActionState

type NetworkActionState struct {
	ExecutionId uuid.UUID
	NetworkOpts json.RawMessage
	Sidecar     netfault.SidecarOpts
	ContainerID string
	TargetLabel string
	// QdiscSnapshot holds the pre-attack qdisc tree captured by netfault.Apply.
	// It travels through the action_kit_sdk per-execution state so Stop can
	// hand it back to netfault.Revert and restore the original (cloud-tuned)
	// root after the attack tree is torn down. Empty when strict-mode is on,
	// the attack doesn't touch a tc root, or the capture itself errored.
	QdiscSnapshot netfault.QdiscSnapshot
	// IsShadow is true when this action's Start found another concurrent
	// action already attacking the same netns WITH IDENTICAL OPTS
	// (multi-container pods share a netns — see netns_dedup.go). Shadow
	// actions do NOT install their own tc rules; only the first (primary)
	// Start applies. Stop mirrors the same split: the primary reverts,
	// shadows no-op. Different opts on a sibling take the passthrough
	// branch instead of shadowing, so this stays false there. The flag
	// lives on state so the primary/shadow decision survives an extension
	// pod restart between Start and Stop.
	IsShadow bool
	// NetnsClaimed records whether Start incremented the netns tracker
	// counter for this action. True for primary and shadow (both hold a
	// claim). False for passthrough (netns was already claimed with
	// different opts, so we didn't touch the tracker). Stop uses this to
	// decide whether it owns a release — without it, an opts-decode or
	// revert error inside Stop would leak the claim for the rest of the
	// process's life and silently shadow every future Start on this netns.
	NetnsClaimed bool
}

type PauseActionState

type PauseActionState struct {
	ContainerId string
	TargetLabel string
}

type StopActionState

type StopActionState struct {
	ContainerId string
	TargetLabel string
	Graceful    bool
	ExecutionId uuid.UUID
}

type StressActionState

type StressActionState struct {
	Sidecar         stress.SidecarOpts
	ContainerID     string
	TargetLabel     string
	StressOpts      stress.Opts
	ExecutionId     uuid.UUID
	IgnoreExitCodes []int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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