Skip to content

Version 1.1.3

Choose a tag to compare

@alexei-led alexei-led released this 28 Apr 16:48
· 26 commits to master since this release
34883a0

Highlights

This patch release lands the modularity refactor (#319) — a deep cleanup of CLI wiring, chaos command plumbing, and runtime adapters. No public CLI behavior changes; existing scripts and flags continue to work. The refactor removes long-standing duplication, paves the way for a future urfave/cli v3 migration, and wires up the previously unreachable --limit flag on netem/iptables parent commands.

Fixes

  • --limit now works on netem and iptables — the parsers always read --limit but the flag was never declared on either parent command, so user-supplied values silently became 0. The flag is now wired up and respected.
  • Sidecar create errors include the failing image name — previously the error template duplicated the tool name (tc, iptables) instead of the image, making debugging pull/registry issues harder.
  • tc/iptables sidecar cleanup tolerates already-completed removals — graceful SIGTERM during a chaos action no longer surfaces spurious errors when Podman has already reaped the sidecar.
  • stop/pause actions report both primary and restart/unpause errors — when restart-after-stop or unpause-after-pause fails, both errors are returned rather than silently dropping one.
  • Stop CLI rejects zero --duration earlier in parsing instead of letting it reach the runtime.

Refactor (internal)

  • chaos.RunOnContainers fanout helper consolidates the list → random-pick → parallel/serial → collect-errors pattern that was duplicated across all 15 chaos action implementations. New chaos actions can no longer drift from the canonical shape.
  • Generic NewAction[P] CLI builder collapses the 17 chaos cmd/*.go files into a uniform shape (flag list + typed ParamParser[P] + CommandFactory[P]).
  • Request value objects replace long positional arg lists on fat interface methods: NetemRequest, IPTablesRequest, StressRequest/StressResult, RemoveOpts. Mock signatures updated accordingly.
  • cliflags.Flags adapter decouples chaos parsers from urfave/cli v1, isolating the future v3 migration to a single file.
  • pkg/runtime/podman package documents the Docker SDK embedding invariant and the cgroup leaf-naming gotchas (libpod-<id>.scope/container).
  • util.ValidateInterfaceName centralizes the network-interface regex previously duplicated across netem and iptables parsers.
  • cmd/main.go split into 5 focused per-concern files (each ≤ 200 LOC): main.go, runtime.go, logging.go, flags.go, commands.go.
  • pkg/runtime/docker/sidecar.go consolidates tc and iptables sidecar lifecycle (create → start → exec → force-remove) into one helper. Sidecar StopSignal: "SIGKILL" skips Podman's 10-second SIGTERM grace window.
  • Containerd runtime split per concern: client.go, api.go, container.go, task.go, commands.go, cgroup.go, sidecar.go, netem.go, iptables.go, stress.go, stress_sidecar.go (every production file ≤ 250 LOC).

Tests and CI

  • Local integration tests now run inside runtime VMs — Docker/containerd in Colima, Podman in podman machine. The bats suite runs on a real kernel against real sockets instead of a fragile macOS-side proxy.
  • stress-ng image pinned to 0.20.01 in tests and CI prepull steps. Floating :latest left stale 0.20.00 cached locally, which lacks /cg-inject and silently skipped the inject-cgroup test. The contract is now enforced (fail, not skip).
  • Unit coverage gains: pkg/chaos 69% → 98.5%, pkg/chaos/lifecycle 82.6% → 100%. Adds focused tests for ParseGlobalParams, lifecycle constructors, and the context.WithoutCancel cleanup path that runs on SIGTERM during stop/pause.

Compatibility

  • No API or CLI breaking changes. All existing pumba invocations continue to work.
  • Docker SDK pinned at v28.5.2; containerd SDK v2; Go 1.26; urfave/cli v1 (v3 migration deferred).