feat(node): Add the --join flag to the run command to register and enroll in one step#188
feat(node): Add the --join flag to the run command to register and enroll in one step#188kaisoz wants to merge 1 commit into
--join flag to the run command to register and enroll in one step#188Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a --join flag to the run command of sam-node, allowing users to enroll and start their node in a single step. It refactors the interactive login flow into a helper function, updates the quickstart documentation to highlight this new simplified flow, and promotes go-isatty to a direct dependency. Feedback on the changes points out that when --join is used in a non-interactive TTY environment, the hub address does not default to the community testnet as documented, and suggests updating the fallback logic to ensure consistency.
| if !isatty.IsTerminal(os.Stdin.Fd()) { | ||
| logger.Warn("--join set but no interactive TTY; starting unauthenticated sidecar for out-of-band enrollment") | ||
| } else { |
There was a problem hiding this comment.
When --join is set but there is no interactive TTY, the node starts an unauthenticated sidecar. However, if --hub is not explicitly changed, hubAddr remains set to the default production hub (node.DefaultHubURL), rather than defaulting to the community testnet (https://bananas.sam-mesh.dev) as documented. We should update hubAddr to the testnet URL in this non-interactive case to ensure consistency with the interactive flow.
if !isatty.IsTerminal(os.Stdin.Fd()) {
if !cmd.Flags().Changed("hub") {
hubAddr = "https://bananas.sam-mesh.dev"
}
logger.Warn("--join set but no interactive TTY; starting unauthenticated sidecar for out-of-band enrollment")
} else {64886f3 to
36c5526
Compare
No description provided.