tsnet: clarify that ListenService starts the server if necessary
Every other listen method on tsnet.Server makes this clarification, so should ListenService. Fixes tailscale/corp#36207 Signed-off-by: Harry Harpham <harry@tailscale.com>
This commit is contained in:
@@ -1410,6 +1410,8 @@ var ErrUntaggedServiceHost = errors.New("service hosts must be tagged nodes")
|
|||||||
// To advertise a Service with multiple ports, run ListenService multiple times.
|
// To advertise a Service with multiple ports, run ListenService multiple times.
|
||||||
// For more information about Services, see
|
// For more information about Services, see
|
||||||
// https://tailscale.com/kb/1552/tailscale-services
|
// https://tailscale.com/kb/1552/tailscale-services
|
||||||
|
//
|
||||||
|
// This function will start the server if it is not already started.
|
||||||
func (s *Server) ListenService(name string, mode ServiceMode) (*ServiceListener, error) {
|
func (s *Server) ListenService(name string, mode ServiceMode) (*ServiceListener, error) {
|
||||||
if err := tailcfg.ServiceName(name).Validate(); err != nil {
|
if err := tailcfg.ServiceName(name).Validate(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user