types: remove viper

Updates #1926
This commit is contained in:
Kristoffer Dalby committed 2026-11-11 15:02:16 +01:00
1 parent cb4ccd97c2
commit 3e12fa9d39
9 files changed
+34 -195

No files matched your search

-4
View File
@@ -10,7 +10,6 @@ import (
policyv2 "github.com/juanfont/headscale/hscontrol/policy/v2"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
)
@@ -149,9 +148,6 @@ func writeFile(t *testing.T, dir, name, content string) string {
func runCheck(t *testing.T, c *cobra.Command, file string) (string, error) {
t.Helper()
viper.Reset()
t.Cleanup(viper.Reset)
cmd := &cobra.Command{}
cmd.Flags().String("file", file, "")
-6
View File
@@ -10,7 +10,6 @@ import (
"github.com/juanfont/headscale/hscontrol/types"
"github.com/rs/zerolog"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
)
@@ -349,9 +348,6 @@ func TestOfflineSetPolicyRunsTests(t *testing.T) {
},
} {
t.Run(tt.name, func(t *testing.T) {
viper.Reset()
t.Cleanup(viper.Reset)
dir := t.TempDir()
configPath := filepath.Join(dir, "config.yaml")
config := fmt.Sprintf(`server_url: https://headscale.example.com
@@ -456,8 +452,6 @@ func TestLoadConfig(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
viper.Reset()
t.Cleanup(viper.Reset)
t.Setenv("HEADSCALE_CONFIG", tt.env)
old := cfgFile