Skip to content

fix(launch): omit KeyName from RunInstances when unset (#130) - #131

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/130-empty-keyname
Jun 12, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/130-empty-keyname

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

client.Launch unconditionally set KeyName: aws.String(launchConfig.KeyName), so a headless launch with no key (lagotto --action spawn, SSM-only) sent KeyName: "" — which EC2 rejects (Invalid value '' for keyPairNames). Omitting the field is the supported no-key-pair launch.

Fix: keyNameOrNil (empty → nil, set conditionally) + unit test. Substrate accepts an empty KeyName (same blind spot as #127), so the guard is the pure helper test.

Second blocker after #127 on the lagotto#19 watch→launch→run flow — with both fixed, a headless capacity-triggered launch should finally succeed end-to-end. Closes #130.

client.Launch always set KeyName: aws.String(launchConfig.KeyName), so a headless
launch with no key (lagotto --action spawn, SSM-only) sent KeyName: "" — which
EC2 rejects with "Invalid value '' for keyPairNames". Omitting the field is the
supported "no key pair" launch. Extract keyNameOrNil (empty → nil pointer) +
test. Second blocker after #127 on the lagotto#19 flow.
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/aws/client.go 45.45% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 4113966 into main Jun 12, 2026
3 checks passed
@scttfrdmn
scttfrdmn deleted the fix/130-empty-keyname branch June 12, 2026 20:30
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.

client.Launch sends empty KeyName to RunInstances; headless/SSM launch fails with 'keyPairNames should not be blank'

1 participant