mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-24 16:41:30 +02:00
fix a linter issue
Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
This commit is contained in:
@@ -2,6 +2,7 @@ package networkmapdbfactory
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
@@ -17,6 +18,8 @@ import (
|
||||
|
||||
const storeSqliteFileName = "store.db"
|
||||
|
||||
var NotSupportedStoreEngineError = errors.New("unsupported store engine")
|
||||
|
||||
func NewNetworkMapDBStore(
|
||||
ctx context.Context,
|
||||
kind types.Engine,
|
||||
@@ -58,7 +61,7 @@ func NewNetworkMapDBStore(
|
||||
}, nil
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
return nil, fmt.Errorf("networkmap store doesn't support engine %s, %w", kind, NotSupportedStoreEngineError)
|
||||
}
|
||||
|
||||
func mustLookupDsnEnv() (string, error) {
|
||||
|
||||
@@ -5,6 +5,7 @@ package server
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"slices"
|
||||
@@ -111,7 +112,10 @@ func (s *BaseServer) NetworkMapStore() *networkmapdb.NetworkMapDBStoreImpl {
|
||||
s.Config.Datadir,
|
||||
s.IntegratedValidator(),
|
||||
s.SettingsManager())
|
||||
if err != nil {
|
||||
// networkmap db store supports postgres and sqlite backends only
|
||||
// for other backends a fallback is used, so NotSupportedStoreEngineError
|
||||
// is not a fatal error
|
||||
if err != nil && !errors.Is(err, networkmapdbfactory.NotSupportedStoreEngineError) {
|
||||
log.Fatalf("failed to create network map store: %v", err)
|
||||
}
|
||||
return store
|
||||
|
||||
Reference in New Issue
Block a user