Skip to content

feat(node): Add the --join flag to the run command to register and enroll in one step#188

Open
kaisoz wants to merge 1 commit into
google:mainfrom
kaisoz:feat/run-join-flag
Open

feat(node): Add the --join flag to the run command to register and enroll in one step#188
kaisoz wants to merge 1 commit into
google:mainfrom
kaisoz:feat/run-join-flag

Conversation

@kaisoz

@kaisoz kaisoz commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@google-cla

google-cla Bot commented Jul 9, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cmd/sam-node/main.go
Comment on lines +234 to +236
if !isatty.IsTerminal(os.Stdin.Fd()) {
logger.Warn("--join set but no interactive TTY; starting unauthenticated sidecar for out-of-band enrollment")
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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 {

@kaisoz kaisoz force-pushed the feat/run-join-flag branch from 64886f3 to 36c5526 Compare July 9, 2026 20:34
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.

1 participant