[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:
jnfrati
2026-08-25 11:03:33 +02:00
parent 9bb006a3d7
commit 0646d8fc78
6 changed files with 132 additions and 67 deletions
+3 -1
View File
@@ -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")