feat: [ENG-2203] node create accepts cloud-init user data script#189
Conversation
Changed Files
|
There was a problem hiding this comment.
Greptile Summary
This PR implements cloud-init user data script support for the node create command, enabling users to provide startup scripts that run during VM boot. The changes add two new mutually exclusive command-line options: --user-data for inline scripts and --user-data-file for reading scripts from files.
The implementation follows established CLI patterns by adding the new options to the Commander.js configuration with proper conflict resolution. When users provide user data, it's converted to a byte array using TextEncoder and passed to the nodes SDK as the cloud_init_user_data parameter. The file reading functionality includes appropriate error handling that throws descriptive CommanderError messages when files cannot be read.
To support this functionality, the PR also upgrades the @sfcompute/nodes-sdk-alpha dependency from version 0.1.0-alpha.10 to 0.1.0-alpha.12. This SDK upgrade was necessary to access the updated API interface that includes the new cloud_init_user_data parameter in the NodeCreateParams interface. The feature integrates seamlessly with the existing node creation workflow, enhancing the CLI's capabilities for VM customization and automated setup during boot time.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it adds optional functionality without modifying existing behavior
- Score reflects well-structured implementation following existing patterns and proper error handling, though the alpha SDK dependency introduces some uncertainty
- Pay close attention to the SDK version compatibility and ensure the alpha.12 version is stable for production use
2 files reviewed, 1 comment
Uh oh!
There was an error while loading. Please reload this page.