Skip to content

feat(cluster): confirm before bootstrap turns the machine into a cluster node#206

Merged
incognick merged 1 commit into
mainfrom
feat/bootstrap-confirm-guard
Jul 3, 2026
Merged

feat(cluster): confirm before bootstrap turns the machine into a cluster node#206
incognick merged 1 commit into
mainfrom
feat/bootstrap-confirm-guard

Conversation

@incognick

Copy link
Copy Markdown
Contributor

burrow cluster bootstrap installs k3s and burrowd on the current machine, so an accidental run on a laptop (e.g. curl -sfL <script> | sudo sh) would convert it into a cluster node. It now warns and requires confirmation before any destructive action.

What changed

  • A pre-flight warning is printed before bootstrap mutates the machine: it states that bootstrap installs k3s and turns THIS machine into a Burrow cluster node (a systemd k3s service, burrowd, and Postgres), and to run it on a fresh server or VPS, not a laptop.
  • The confirmation ("Continue? [y/N]") defaults to No: an empty line or anything but y/yes declines and aborts cleanly ("Aborted; nothing was changed.") before any install.
  • The answer is read from /dev/tty, not stdin, so the prompt still reaches the user under curl -sfL <script> | sh, where the process stdin is the piped install script rather than the keyboard. The read sits behind a confirmFn seam (like the existing newIPDetector/newK3sInstaller seams) so tests inject the answer without a real terminal.
  • A --yes bool flag skips the prompt for intentional automation. The get.burrow.dev script does not pass it, so an interactive user always gets the prompt.
  • When there is no controlling terminal (/dev/tty cannot be opened) and --yes was not passed, bootstrap refuses with guidance to pass --yes rather than hanging or silently proceeding.
  • The already-installed idempotent-skip case stays a no-op: when k3s is already running there is nothing destructive to do, so no confirmation is prompted.

Tests

Added to cmd/burrow/bootstrap_test.go, all seams faked (no real network, k3s, or cluster): --yes skips the prompt and installs; a confirmed "yes" proceeds; a declined "no" aborts cleanly with the installer never called; no-tty without --yes errors with --yes guidance and does not install; an already-running box skips the prompt. The existing bootstrap tests stay green.

https://claude.ai/code/session_012euqxgVqHP5yQWi2HxDPKt

…ter node

`burrow cluster bootstrap` installs k3s and burrowd on the current machine, so
an accidental run on a laptop would convert it into a cluster node; it now warns
and requires confirmation before any destructive action, reading the answer from
/dev/tty so the prompt works under `curl | sh`, defaulting to no, with a `--yes`
bypass for automation and a clear abort when there is no terminal and no `--yes`.

Signed-off-by: Nicholas Phillips <nsphilli@gmail.com>
@incognick incognick added the pr-ready A PR is open and ready for review label Jul 3, 2026
@incognick incognick enabled auto-merge July 3, 2026 23:41
@incognick incognick added this pull request to the merge queue Jul 3, 2026
Merged via the queue into main with commit 6fa4a74 Jul 3, 2026
5 checks passed
@incognick incognick deleted the feat/bootstrap-confirm-guard branch July 3, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ready A PR is open and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant