tsnet: fix mem.Store check for normal nodes

There was a typo in the check it was doing `!ok` instead of `ok`, this
restructures it a bit to read better.

Fixes #4506

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/4513/head
Maisem Ali 2 years ago committed by Maisem Ali
parent d819bb3bb0
commit bbca2c78cb

@ -137,8 +137,9 @@ func (s *Server) start() error {
}
s.rootPath = s.Dir
if s.Store != nil && !s.Ephemeral {
if _, ok := s.Store.(*mem.Store); !ok {
if s.Store != nil {
_, isMemStore := s.Store.(*mem.Store)
if isMemStore && !s.Ephemeral {
return fmt.Errorf("in-memory store is only supported for Ephemeral nodes")
}
}

Loading…
Cancel
Save