|
31 | 31 | import org.elasticsearch.script.ScriptService;
|
32 | 32 | import org.elasticsearch.threadpool.FixedExecutorBuilder;
|
33 | 33 | import org.elasticsearch.transport.RemoteClusterService;
|
| 34 | +import org.elasticsearch.transport.SniffConnectionStrategy; |
34 | 35 | import org.elasticsearch.xpack.core.XPackSettings;
|
35 | 36 | import org.elasticsearch.xpack.core.security.SecurityField;
|
36 | 37 | import org.elasticsearch.xpack.core.security.authc.RealmConfig;
|
@@ -593,6 +594,50 @@ static DeprecationIssue checkMonitoringExporterPassword(
|
593 | 594 | return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
594 | 595 | }
|
595 | 596 |
|
| 597 | + static DeprecationIssue checkSearchRemoteSettings( |
| 598 | + final Settings settings, |
| 599 | + final PluginsAndModules pluginsAndModules, |
| 600 | + ClusterState cs, |
| 601 | + XPackLicenseState licenseState |
| 602 | + ) { |
| 603 | + List<Setting<?>> remoteClusterSettings = new ArrayList<>(); |
| 604 | + remoteClusterSettings.addAll(SniffConnectionStrategy.SEARCH_REMOTE_CLUSTERS_SEEDS.getAllConcreteSettings(settings) |
| 605 | + .sorted(Comparator.comparing(Setting::getKey)).collect(Collectors.toList())); |
| 606 | + remoteClusterSettings.addAll(SniffConnectionStrategy.SEARCH_REMOTE_CLUSTERS_PROXY.getAllConcreteSettings(settings) |
| 607 | + .sorted(Comparator.comparing(Setting::getKey)).collect(Collectors.toList())); |
| 608 | + remoteClusterSettings.addAll(RemoteClusterService.SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE.getAllConcreteSettings(settings) |
| 609 | + .sorted(Comparator.comparing(Setting::getKey)).collect(Collectors.toList())); |
| 610 | + if (SniffConnectionStrategy.SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER.exists(settings)) { |
| 611 | + remoteClusterSettings.add(SniffConnectionStrategy.SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER); |
| 612 | + } |
| 613 | + if (RemoteClusterService.SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING.exists(settings)) { |
| 614 | + remoteClusterSettings.add(RemoteClusterService.SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING); |
| 615 | + } |
| 616 | + if (RemoteClusterService.SEARCH_REMOTE_NODE_ATTRIBUTE.exists(settings)) { |
| 617 | + remoteClusterSettings.add(RemoteClusterService.SEARCH_REMOTE_NODE_ATTRIBUTE); |
| 618 | + } |
| 619 | + if (RemoteClusterService.SEARCH_ENABLE_REMOTE_CLUSTERS.exists(settings)) { |
| 620 | + remoteClusterSettings.add(RemoteClusterService.SEARCH_ENABLE_REMOTE_CLUSTERS); |
| 621 | + } |
| 622 | + if (remoteClusterSettings.isEmpty()) { |
| 623 | + return null; |
| 624 | + } |
| 625 | + final String remoteClusterSeedSettings = remoteClusterSettings.stream().map(Setting::getKey).collect(Collectors.joining(",")); |
| 626 | + final String message = String.format( |
| 627 | + Locale.ROOT, |
| 628 | + "search.remote settings [%s] are deprecated and will be removed in the next major version", |
| 629 | + remoteClusterSeedSettings |
| 630 | + ); |
| 631 | + final String details = String.format( |
| 632 | + Locale.ROOT, |
| 633 | + "replace search.remote settings [%s] with their secure 'cluster.remote' replacements", |
| 634 | + remoteClusterSeedSettings |
| 635 | + ); |
| 636 | + final String url = |
| 637 | + "https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.0.html#breaking_80_settings_changes"; |
| 638 | + return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null); |
| 639 | + } |
| 640 | + |
596 | 641 | static DeprecationIssue checkClusterRoutingAllocationIncludeRelocationsSetting(final Settings settings,
|
597 | 642 | final PluginsAndModules pluginsAndModules,
|
598 | 643 | final ClusterState clusterState,
|
|
0 commit comments