Revert renaming of index templates

Renaming them is particularly difficult and possibly not worth the struggle.

Challenges:
- Just renaming doesn't work as the already installed index template would conflict (same priority, same index pattern)
- We could increase the priority of the renamed index template but there may be user-defined index templates with the same priority (101)
- We could decrease the priority of the old index template but there's a chance that this update can fail

We can still consider renaming index templates as part of a separate PR.
But removing it from this PR to decouple that from the more important and simpler renaming of component templates.
This commit is contained in:
Felix Barnsteiner 2023-10-17 13:13:50 +02:00
parent 667ddf05fe
commit 7fd04237bf
No known key found for this signature in database
GPG key ID: B13943FF9047831D
6 changed files with 14 additions and 18 deletions

View file

@ -636,7 +636,7 @@ public class LogsDataStreamIT extends DisabledSecurityDataStreamTestCase {
static void waitForLogs(RestClient client) throws Exception {
assertBusy(() -> {
try {
Request request = new Request("GET", "_index_template/logs@template");
Request request = new Request("GET", "_index_template/logs");
assertOK(client.performRequest(request));
} catch (ResponseException e) {
fail(e.getMessage());

View file

@ -1886,13 +1886,11 @@ public abstract class ESRestTestCase extends ESTestCase {
case ".profiling-ilm-lock": // TODO: Remove after switch to K/V indices
case "saml-service-provider":
case "logs":
case "logs@template":
case "logs-settings":
case "logs@settings":
case "logs-mappings":
case "logs@mappings":
case "metrics":
case "metrics@template":
case "metrics-settings":
case "metrics@settings":
case "metrics-tsdb-settings":
@ -1900,7 +1898,6 @@ public abstract class ESRestTestCase extends ESTestCase {
case "metrics-mappings":
case "metrics@mappings":
case "synthetics":
case "synthetics@template":
case "synthetics-settings":
case "synthetics@settings":
case "synthetics-mappings":
@ -1915,7 +1912,6 @@ public abstract class ESRestTestCase extends ESTestCase {
case "ecs@mappings":
case "search-acl-filter":
case ".kibana-reporting":
case ".kibana-reporting@template":
return true;
default:
return false;

View file

@ -50,9 +50,9 @@ public class DataStreamRestIT extends ESRestTestCase {
assertThat(dataStreams.get("data_streams"), anyOf(equalTo(null), equalTo(0)));
assertBusy(() -> {
Map<?, ?> logsTemplate = (Map<?, ?>) ((List<?>) getLocation("/_index_template/logs@template").get("index_templates")).get(0);
Map<?, ?> logsTemplate = (Map<?, ?>) ((List<?>) getLocation("/_index_template/logs").get("index_templates")).get(0);
assertThat(logsTemplate, notNullValue());
assertThat(logsTemplate.get("name"), equalTo("logs@template"));
assertThat(logsTemplate.get("name"), equalTo("logs"));
assertThat(((Map<?, ?>) logsTemplate.get("index_template")).get("data_stream"), notNullValue());
});

View file

@ -30,7 +30,7 @@ public class StackTemplatesRestIT extends ESRestTestCase {
// Ensure the logs template has been added
assertBusy(() -> {
try {
Request request = new Request("GET", "_index_template/logs@template");
Request request = new Request("GET", "_index_template/logs");
assertOK(client.performRequest(request));
} catch (ResponseException e) {
fail(e.getMessage());
@ -48,10 +48,10 @@ public class StackTemplatesRestIT extends ESRestTestCase {
""");
assertOK(client.performRequest(request));
}
Request getRequest = new Request("GET", "_index_template/logs@template");
Request getRequest = new Request("GET", "_index_template/logs");
assertOK(client.performRequest(getRequest));
Request deleteRequest = new Request("DELETE", "_index_template/logs@template");
Request deleteRequest = new Request("DELETE", "_index_template/logs");
assertOK(client.performRequest(deleteRequest));
ResponseException exception = expectThrows(ResponseException.class, () -> client.performRequest(deleteRequest));
assertThat(exception.getResponse().getStatusLine().getStatusCode(), is(404));

View file

@ -64,19 +64,19 @@ setup:
- do:
indices.get_index_template:
name: logs@template
name: logs
- do:
indices.get_index_template:
name: metrics@template
name: metrics
- do:
indices.get_index_template:
name: synthetics@template
name: synthetics
- do:
indices.get_index_template:
name: .kibana-reporting@template
name: .kibana-reporting
---
"Test logs index auto creation":

View file

@ -76,7 +76,7 @@ public class StackTemplateRegistry extends IndexTemplateRegistry {
public static final String LOGS_MAPPINGS_COMPONENT_TEMPLATE_NAME = "logs@mappings";
public static final String LOGS_SETTINGS_COMPONENT_TEMPLATE_NAME = "logs@settings";
public static final String LOGS_ILM_POLICY_NAME = "logs@lifecycle";
public static final String LOGS_INDEX_TEMPLATE_NAME = "logs@template";
public static final String LOGS_INDEX_TEMPLATE_NAME = "logs";
//////////////////////////////////////////////////////////
// Metrics components (for matching metric-*-* indices)
@ -85,7 +85,7 @@ public class StackTemplateRegistry extends IndexTemplateRegistry {
public static final String METRICS_SETTINGS_COMPONENT_TEMPLATE_NAME = "metrics@settings";
public static final String METRICS_TSDB_SETTINGS_COMPONENT_TEMPLATE_NAME = "metrics@tsdb-settings";
public static final String METRICS_ILM_POLICY_NAME = "metrics@lifecycle";
public static final String METRICS_INDEX_TEMPLATE_NAME = "metrics@template";
public static final String METRICS_INDEX_TEMPLATE_NAME = "metrics";
//////////////////////////////////////////////////////////
// Synthetics components (for matching synthetics-*-* indices)
@ -93,12 +93,12 @@ public class StackTemplateRegistry extends IndexTemplateRegistry {
public static final String SYNTHETICS_MAPPINGS_COMPONENT_TEMPLATE_NAME = "synthetics@mappings";
public static final String SYNTHETICS_SETTINGS_COMPONENT_TEMPLATE_NAME = "synthetics@settings";
public static final String SYNTHETICS_ILM_POLICY_NAME = "synthetics@lifecycle";
public static final String SYNTHETICS_INDEX_TEMPLATE_NAME = "synthetics@template";
public static final String SYNTHETICS_INDEX_TEMPLATE_NAME = "synthetics";
///////////////////////////////////
// Kibana reporting template
///////////////////////////////////
public static final String KIBANA_REPORTING_INDEX_TEMPLATE_NAME = ".kibana-reporting@template";
public static final String KIBANA_REPORTING_INDEX_TEMPLATE_NAME = ".kibana-reporting";
public StackTemplateRegistry(
Settings nodeSettings,