From b4347c61b3421cf374c867b142042dcfac0a2da5 Mon Sep 17 00:00:00 2001 From: Erwan Guyader Date: Thu, 21 Nov 2024 17:06:47 +0100 Subject: [PATCH] WIP: test: Create default context in config --- model/oauth/client_test.go | 1 - pkg/config/config/config.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/model/oauth/client_test.go b/model/oauth/client_test.go index 98caa78e9d5..18355329fc2 100644 --- a/model/oauth/client_test.go +++ b/model/oauth/client_test.go @@ -38,7 +38,6 @@ func TestClient(t *testing.T) { API: config.ClouderyAPI{URL: "http://manager.example.org", Token: ""}, }, } - conf.Contexts[config.DefaultInstanceContext] = map[string]interface{}{} setup := testutils.NewSetup(t, t.Name()) testInstance := setup.GetTestInstance() diff --git a/pkg/config/config/config.go b/pkg/config/config/config.go index 8199fb1c122..0b9e31f412b 100644 --- a/pkg/config/config/config.go +++ b/pkg/config/config/config.go @@ -1150,6 +1150,7 @@ func createTestViper() *viper.Viper { v.SetDefault("log.level", "info") v.SetDefault("assets_polling_disabled", false) v.SetDefault("assets_polling_interval", 2*time.Minute) + v.SetDefault("contexts", map[string]interface{}{DefaultInstanceContext: map[string]interface{}{}}) applyDefaults(v) return v }