Create a new config setting, and migrate the old values to new. https://mattermost.atlassian.net/browse/MM-63652 Skip-Enterprise-PR: true ```release-note NONE ``` * fix i18n also fix unit tests ```release-note NONE ``` * For fresh installations, default to true ```release-note NONE ``` * gofmt files ```release-note NONE ``` * Fixing some more strings ```release-note NONE ``` * Update e2e tests ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7f4fbd803a
Коммит
3a6aeee57e
@@ -823,14 +823,13 @@ func (ts *TelemetryService) trackConfig() {
|
||||
}
|
||||
|
||||
configs[TrackConfigCluster] = map[string]any{
|
||||
"enable": *cfg.ClusterSettings.Enable,
|
||||
"network_interface": isDefault(*cfg.ClusterSettings.NetworkInterface, ""),
|
||||
"bind_address": isDefault(*cfg.ClusterSettings.BindAddress, ""),
|
||||
"advertise_address": isDefault(*cfg.ClusterSettings.AdvertiseAddress, ""),
|
||||
"use_ip_address": *cfg.ClusterSettings.UseIPAddress,
|
||||
"enable_experimental_gossip_encryption": *cfg.ClusterSettings.EnableExperimentalGossipEncryption,
|
||||
"enable_gossip_compression": *cfg.ClusterSettings.EnableGossipCompression,
|
||||
"read_only_config": *cfg.ClusterSettings.ReadOnlyConfig,
|
||||
"enable": *cfg.ClusterSettings.Enable,
|
||||
"network_interface": isDefault(*cfg.ClusterSettings.NetworkInterface, ""),
|
||||
"bind_address": isDefault(*cfg.ClusterSettings.BindAddress, ""),
|
||||
"advertise_address": isDefault(*cfg.ClusterSettings.AdvertiseAddress, ""),
|
||||
"use_ip_address": *cfg.ClusterSettings.UseIPAddress,
|
||||
"enable_gossip_compression": *cfg.ClusterSettings.EnableGossipCompression,
|
||||
"read_only_config": *cfg.ClusterSettings.ReadOnlyConfig,
|
||||
}
|
||||
|
||||
configs[TrackConfigMetrics] = map[string]any{
|
||||
|
||||
@@ -1054,17 +1054,19 @@ func (s *CacheSettings) isValid() *AppError {
|
||||
}
|
||||
|
||||
type ClusterSettings struct {
|
||||
Enable *bool `access:"environment_high_availability,write_restrictable"`
|
||||
ClusterName *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
OverrideHostname *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
NetworkInterface *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
BindAddress *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
AdvertiseAddress *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
UseIPAddress *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
EnableGossipCompression *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
EnableExperimentalGossipEncryption *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
ReadOnlyConfig *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
GossipPort *int `access:"environment_high_availability,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
Enable *bool `access:"environment_high_availability,write_restrictable"`
|
||||
ClusterName *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
OverrideHostname *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
NetworkInterface *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
BindAddress *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
AdvertiseAddress *string `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
UseIPAddress *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
EnableGossipCompression *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
// Deprecated: use EnableGossipEncryption
|
||||
EnableExperimentalGossipEncryption *bool `json:",omitempty"`
|
||||
EnableGossipEncryption *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
ReadOnlyConfig *bool `access:"environment_high_availability,write_restrictable,cloud_restrictable"`
|
||||
GossipPort *int `access:"environment_high_availability,write_restrictable,cloud_restrictable"` // telemetry: none
|
||||
}
|
||||
|
||||
func (s *ClusterSettings) SetDefaults() {
|
||||
@@ -1096,8 +1098,12 @@ func (s *ClusterSettings) SetDefaults() {
|
||||
s.UseIPAddress = NewPointer(true)
|
||||
}
|
||||
|
||||
if s.EnableExperimentalGossipEncryption == nil {
|
||||
s.EnableExperimentalGossipEncryption = NewPointer(false)
|
||||
if s.EnableGossipEncryption == nil {
|
||||
if s.EnableExperimentalGossipEncryption != nil {
|
||||
s.EnableGossipEncryption = NewPointer(*s.EnableExperimentalGossipEncryption)
|
||||
} else {
|
||||
s.EnableGossipEncryption = NewPointer(true)
|
||||
}
|
||||
}
|
||||
|
||||
if s.EnableGossipCompression == nil {
|
||||
|
||||
@@ -35,7 +35,8 @@ func TestConfigDefaults(t *testing.T) {
|
||||
// Ignoring these 2 settings.
|
||||
// TODO: remove them completely in v8.0.
|
||||
if name == "config.BleveSettings.BulkIndexingTimeWindowSeconds" ||
|
||||
name == "config.ElasticsearchSettings.BulkIndexingTimeWindowSeconds" {
|
||||
name == "config.ElasticsearchSettings.BulkIndexingTimeWindowSeconds" ||
|
||||
name == "config.ClusterSettings.EnableExperimentalGossipEncryption" {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1037,7 +1037,8 @@ func checkNowhereNil(t *testing.T, name string, value any) bool {
|
||||
// Ignoring these 2 settings.
|
||||
// TODO: remove them completely in v8.0.
|
||||
if name == "config.BleveSettings.BulkIndexingTimeWindowSeconds" ||
|
||||
name == "config.ElasticsearchSettings.BulkIndexingTimeWindowSeconds" {
|
||||
name == "config.ElasticsearchSettings.BulkIndexingTimeWindowSeconds" ||
|
||||
name == "config.ClusterSettings.EnableExperimentalGossipEncryption" {
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user