@@ -333,8 +333,12 @@ func runRegisterSteps(ctx context.Context, t *terminal.Terminal, s RegisterStore
333333 return nil , fmt .Errorf ("node registered but failed to save locally: %w" , err )
334334 }
335335
336- runSetup (node , t , deps )
336+ err = runSetup (node , deps )
337337 stopSpinner ()
338+ if err != nil {
339+ return nil , fmt .Errorf ("setup command failed: %w" , err )
340+ }
341+
338342 t .Vprintf ("%s Node registered.\n " , t .Green (" ✓" ))
339343 t .Vprintf ("%s Registration complete.\n " , t .Green (" ✓" ))
340344 return reg , nil
@@ -421,19 +425,18 @@ func netbirdManagementConnected(statusOutput string) bool {
421425 return false
422426}
423427
424- func runSetup (node * nodev1.ExternalNode , t * terminal. Terminal , deps registerDeps ) {
428+ func runSetup (node * nodev1.ExternalNode , deps registerDeps ) error {
425429 ci := node .GetConnectivityInfo ()
426430 if ci == nil || ci .GetRegistrationCommand () == "" {
427- t .Vprintf (" %s\n " , t .Yellow ("Warning: Brev tunnel setup failed, please try again." ))
428- } else {
429- if err := deps .setupRunner .RunSetup (ci .GetRegistrationCommand ()); err != nil {
430- t .Vprintf (" Warning: setup command failed: %v\n " , err )
431- } else {
432- // netbird up reconfigures network routes; give them a moment
433- // to settle before making further RPC calls.
434- time .Sleep (2 * time .Second )
435- }
431+ return fmt .Errorf ("brev tunnel setup failed, please try again" )
436432 }
433+
434+ err := deps .setupRunner .RunSetup (ci .GetRegistrationCommand ())
435+ if err != nil {
436+ return fmt .Errorf ("setup command failed: %w" , err )
437+ }
438+
439+ return nil
437440}
438441
439442// grantSSHAccessWithPort enables SSH: shows confirm table, uses port or prompts if port is 0, then allocates port and grants access.
0 commit comments