@ -233,8 +233,7 @@ func (s *Server) Up(ctx context.Context) (*ipnstate.Status, error) {
return nil , fmt . Errorf ( "tsnet.Up: backend: %s" , * n . ErrMessage )
return nil , fmt . Errorf ( "tsnet.Up: backend: %s" , * n . ErrMessage )
}
}
if s := n . State ; s != nil {
if s := n . State ; s != nil {
switch * s {
if * s == ipn . Running {
case ipn . Running :
status , err := lc . Status ( ctx )
status , err := lc . Status ( ctx )
if err != nil {
if err != nil {
return nil , fmt . Errorf ( "tsnet.Up: %w" , err )
return nil , fmt . Errorf ( "tsnet.Up: %w" , err )
@ -243,15 +242,13 @@ func (s *Server) Up(ctx context.Context) (*ipnstate.Status, error) {
return nil , errors . New ( "tsnet.Up: running, but no ip" )
return nil , errors . New ( "tsnet.Up: running, but no ip" )
}
}
return status , nil
return status , nil
case ipn . NeedsMachineAuth :
return nil , errors . New ( "tsnet.Up: tailnet requested machine auth" )
}
}
// TODO: in the future, return an error on NeedsLogin
// TODO: in the future, return an error on ipn.NeedsLogin
// to improve the UX of trying out the tsnet package.
// and ipn.NeedsMachineAuth to improve the UX of trying
// out the tsnet package.
//
//
// Unfortunately today, even when using an AuthKey we
// Unfortunately today, even when using an AuthKey we
// briefly see a NeedsLogin state. It would be nice
// briefly see these states. It would be nice to fix.
// to fix that.
}
}
}
}
}
}