Repository navigation
fix(launcher): base64-encode user-data in Provision (#127) - #128
Merged
Merged
Conversation
Provision assigned the raw BuildLinuxBootstrap script to LaunchConfig.UserData, which Launch passes verbatim to RunInstances — but EC2 requires base64. So every headless launch (lagotto --action spawn) failed with "Invalid BASE64 encoding of user data", blocking the lagotto#19 flow on its first real launch. The substrate test missed it because substrate doesn't validate the encoding. Add launcher.EncodeLinuxUserData (gzip+base64, matching the CLI's encodeUserDataForOS for Linux) and use it in Provision. Regression tests assert the encoded output is valid base64 that gunzips back to the script. Also correct the LaunchConfig.UserData doc (it must be base64, not "plain text or base64").
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
launcher.Provisionassigned the raw bootstrap script toLaunchConfig.UserData;Launchpasses it verbatim to RunInstances, which requires base64. Every headless launch (lagotto--action spawn) failed withInvalid BASE64 encoding of user data, blocking the lagotto#19 watch→launch→run flow on its first real launch.Fix: add
launcher.EncodeLinuxUserData(gzip+base64, matching the CLI'sencodeUserDataForOSfor Linux) and use it inProvision. Regression tests decode the output and assert it gunzips back to the script — the contract real EC2 enforces but substrate didn't, which is why the original test missed it. Corrected the misleadingLaunchConfig.UserDatadoc.Closes #127. Needs a spawn patch release + a lagotto bump to consume it.