Refactor user data bootstrapping logic for Flex#26
Merged
Conversation
anson627
approved these changes
Mar 3, 2026
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.
This pull request introduces a major refactor and feature expansion to the Flex node bootstrap configuration, focusing on making the user data generation more flexible, robust, and testable. The key improvements include the adoption of a functional options pattern for configuration, support for multiple CPU architectures, improved validation, and enhanced test coverage.
User Data Generation Refactor and Flexibility
flex.UserDataAPI to use a functional options pattern, allowing callers to specify options like GPU support, Kubernetes version, architecture, and kubeadm config in a more extensible and readable way. This replaces the previous positional-argument approach and makes the API easier to extend in the future. [1] [2]amd64,arm64) and non-empty Kubernetes versions, with clear error messages for invalid inputs.Multi-Architecture and Bootstrap Improvements
--arch) to the CLI for specifying the CPU architecture, defaulting toamd64. The generated bootstrap script and binary download URLs now dynamically use the selected architecture, enabling support for bothamd64andarm64nodes. [1] [2] [3]Testing and Validation Enhancements
UserDataoptions, covering default behavior, architecture selection, invalid inputs, and Kubernetes version handling. This ensures correctness and prevents regressions.These changes collectively improve the flexibility, safety, and maintainability of Flex node bootstrapping, and lay the groundwork for future enhancements.
References:
[1] [2] [3] [4] [5] [6] [7] [8]