Skip to content

fix: keyless status over SSM (#222) + --command >256 via user-data (#214/#246) + hibernate help (#79) - #250

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/222-214-79-prerelease-bugs
Jun 25, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/222-214-79-prerelease-bugs

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Pre-epic bug batch — three contained fixes, one PR.

#222 — spawn status on keyless/SSM-only instances

A lagotto/cohort-launched instance is keyless (SSM-only by design, #130), so status hard-failed with no SSH key configured — but status needs only Describe + SSM, never SSH. It now falls back to spored status over SSM (RunShellScript) when no local key resolves, and propagates spored's --check-complete exit code via the new SSMRunResult.ResponseCode (from GetCommandInvocation.ResponseCode). connect already injects a key over SSM, so status was the remaining gap.

#214 / #246 — --command >256 chars

The command rode the spawn:command EC2 tag, which EC2 caps at 256 chars → any non-trivial command failed RunInstances. The plain --command is now embedded in user-data (/etc/spawn/command via BootstrapConfig.Command, ~16 KB headroom); the bootstrap prefers the embedded file over the tag. The tag is still written for short commands and the parameter-sweep path (short per-instance step refs), but buildTags no longer writes an oversized tag.

#79 — hibernate help text

--hibernate-on-idle said "instead of terminate"; the default idle action is stop (reversible), not terminate. Corrected so users don't avoid the flag thinking the alternative is destructive.

Tests

  • bootstrap: long command round-trips into user-data, written-before-read ordering, no embed when empty
  • buildTags: oversized command not tagged; short command still tagged
  • make check green

Fixes #222, #214, #246, #79.

Part of the pre-epic cleanup; will batch into one release with the already-merged #247/#248.

#246), hibernate help (#79)

Pre-epic bug batch.

#222 — `spawn status` hard-failed "no SSH key configured" on keyless/SSM-only
instances (lagotto/cohort-launched), but status needs only Describe + SSM. It now
falls back to `spored status` over SSM RunShellScript when no local key resolves,
and propagates spored's --check-complete exit code via the new
SSMRunResult.ResponseCode (GetCommandInvocation.ResponseCode). connect already
injects a key over SSM, so the status path was the gap.

#214/#246 — `--command` >256 chars failed RunInstances because the command rode
the spawn:command EC2 tag (256-char cap). The plain --command is now embedded in
user-data (/etc/spawn/command via BootstrapConfig.Command; ~16KB) and the
bootstrap prefers the embedded file over the tag. The tag is still written for
short commands + the parameter-sweep path (cmd/sweep.go sets a short per-instance
tag), but buildTags no longer writes an oversized tag (which would fail the
launch). Non-sweep launches embed; sweeps keep the tag.

#79 — --hibernate-on-idle help said "instead of terminate"; the default idle
action is stop (reversible), not terminate. Corrected.

Tests: bootstrap command-embed (long command round-trips, written-before-read);
no-embed when empty; buildTags drops oversized command but keeps short. make
check green.

Fixes #222, #214, #246, #79.
@scttfrdmn
scttfrdmn merged commit 49c579a into main Jun 25, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the fix/222-214-79-prerelease-bugs branch June 25, 2026 16:32
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.02817% with 44 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/status.go 0.00% 30 Missing ⚠️
cmd/launch.go 9.09% 10 Missing ⚠️
pkg/aws/ssm.go 50.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn status/connect fail with 'no SSH key configured' on keyless lagotto-launched (SSM-only) instances; status shouldn't need a key

1 participant