MM-53962: Adding ES8 dependency (#24399)
* Adding ES8 dependency ```release-note NONE ``` Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a695a755f6
Коммит
177389d224
@@ -7,6 +7,7 @@ func NewBool(b bool) *bool { return &b }
|
||||
func NewInt(n int) *int { return &n }
|
||||
func NewInt64(n int64) *int64 { return &n }
|
||||
func NewString(s string) *string { return &s }
|
||||
func NewPointer[T any](t T) *T { return &t }
|
||||
|
||||
// SafeDereference returns the zero value of T if t is nil.
|
||||
// Otherwise it return the derference of t.
|
||||
|
||||
@@ -205,6 +205,8 @@ const (
|
||||
ElasticsearchSettingsDefaultLiveIndexingBatchSize = 1
|
||||
ElasticsearchSettingsDefaultRequestTimeoutSeconds = 30
|
||||
ElasticsearchSettingsDefaultBatchSize = 10000
|
||||
ElasticsearchSettingsESBackend = "elasticsearch"
|
||||
ElasticsearchSettingsOSBackend = "opensearch"
|
||||
|
||||
BleveSettingsDefaultIndexDir = ""
|
||||
BleveSettingsDefaultBatchSize = 10000
|
||||
@@ -2763,6 +2765,7 @@ func (s *NativeAppSettings) SetDefaults() {
|
||||
|
||||
type ElasticsearchSettings struct {
|
||||
ConnectionURL *string `access:"environment_elasticsearch,write_restrictable,cloud_restrictable"`
|
||||
Backend *string `access:"environment_elasticsearch,write_restrictable,cloud_restrictable"`
|
||||
Username *string `access:"environment_elasticsearch,write_restrictable,cloud_restrictable"`
|
||||
Password *string `access:"environment_elasticsearch,write_restrictable,cloud_restrictable"`
|
||||
EnableIndexing *bool `access:"environment_elasticsearch,write_restrictable,cloud_restrictable"`
|
||||
@@ -2795,6 +2798,10 @@ func (s *ElasticsearchSettings) SetDefaults() {
|
||||
s.ConnectionURL = NewString(ElasticsearchSettingsDefaultConnectionURL)
|
||||
}
|
||||
|
||||
if s.Backend == nil {
|
||||
s.Backend = NewString(ElasticsearchSettingsESBackend)
|
||||
}
|
||||
|
||||
if s.Username == nil {
|
||||
s.Username = NewString(ElasticsearchSettingsDefaultUsername)
|
||||
}
|
||||
@@ -4173,6 +4180,10 @@ func (s *ElasticsearchSettings) isValid() *AppError {
|
||||
}
|
||||
}
|
||||
|
||||
if *s.Backend != ElasticsearchSettingsOSBackend && *s.Backend != ElasticsearchSettingsESBackend {
|
||||
return NewAppError("Config.IsValid", "model.config.is_valid.elastic_search.invalid_backend.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user