[MM-32234] Fix config.json getting reset (#16805)

* Add support for read-only config stores

* Allow read/write config store for plugin commands that require it
Этот коммит содержится в:
Claudio Costa
2021-01-28 20:04:17 +01:00
коммит произвёл GitHub
родитель 77da23e84b
Коммит 9c9fbe6dd9
22 изменённых файлов: 211 добавлений и 92 удалений

Просмотреть файл

@@ -384,7 +384,7 @@ func TestSentry(t *testing.T) {
s, err := NewServer(func(server *Server) error {
configStore, _ := config.NewFileStore("config.json", true)
store, _ := config.NewStoreFromBacking(configStore, nil)
store, _ := config.NewStoreFromBacking(configStore, nil, false)
server.configStore = store
server.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.ListenAddress = ":0"
@@ -435,7 +435,7 @@ func TestSentry(t *testing.T) {
s, err := NewServer(func(server *Server) error {
configStore, _ := config.NewFileStore("config.json", true)
store, _ := config.NewStoreFromBacking(configStore, nil)
store, _ := config.NewStoreFromBacking(configStore, nil, false)
server.configStore = store
server.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.ListenAddress = ":0"