Skip to content

Commit

Permalink
fix: configstore: using DefaultStore instead of a new one
Browse files Browse the repository at this point in the history
Previously, we were using configstore.NewStore() but this is
incompatible with plugins that might need to validate some configuration
from configstore to validate template when importing.
Using configstore.DefaultStore makes sure that every plugins is
listening on the same configstore store.

Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
  • Loading branch information
rbeuque74 committed Jan 31, 2020
1 parent e2e4c7a commit aa26734
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
var hdl http.Handler

func TestMain(m *testing.M) {
store := configstore.NewStore()
store := configstore.DefaultStore
store.InitFromEnvironment()

logrus.SetOutput(os.Stdout)
Expand Down
2 changes: 1 addition & 1 deletion cmd/utask/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var rootCmd = &cobra.Command{
utask.FDebug = viper.GetBool(envDebug)
utask.FMaintenanceMode = viper.GetBool(envMaintenance)

store = configstore.NewStore()
store = configstore.DefaultStore
store.InitFromEnvironment()

defaultAuthHandler, err := basicAuthHandler(store)
Expand Down
2 changes: 1 addition & 1 deletion engine/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
)

func TestMain(m *testing.M) {
store := configstore.NewStore()
store := configstore.DefaultStore
store.InitFromEnvironment()

db.Init(store)
Expand Down

0 comments on commit aa26734

Please sign in to comment.