mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-03 20:19:07 +02:00
[management,misc] Fix configuration migration checks
The initial migration let an empty legacy Datadir override Management defaults and pulled Viper into WASM builds through the common util package. Normalize the Management data directory, isolate template expansion from the loader dependency, and split source binding to satisfy the quality gate.
This commit is contained in:
@@ -11,6 +11,8 @@ import (
|
||||
"github.com/spf13/pflag"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/netbirdio/netbird/util/envtemplate"
|
||||
)
|
||||
|
||||
type testConfig struct {
|
||||
@@ -138,7 +140,7 @@ server:
|
||||
|
||||
cfg, err := Load(configPath, defaultTestConfig(), Options{
|
||||
TagName: "yaml",
|
||||
Transform: ExpandEnvTemplate,
|
||||
Transform: envtemplate.Expand,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, ":8443", cfg.Server.Address, "The transform should run before decoding")
|
||||
|
||||
Reference in New Issue
Block a user