diff --git a/scripts/compare_against_released_patterns_test.py b/scripts/compare_against_released_patterns_test.py index 3267acb..90f8279 100644 --- a/scripts/compare_against_released_patterns_test.py +++ b/scripts/compare_against_released_patterns_test.py @@ -151,7 +151,10 @@ def _support_index_pattern_fields_field_only(self, released_file_URL, es_version generated_fields = [item for item in generated_fields if not item["name"] == "systemd.t.LINE_BREAK"] generated_fields = [item for item in generated_fields if not item["name"] == "systemd.t.STREAM_ID"] generated_fields = [item for item in generated_fields if not item["name"] == "systemd.t.SYSTEMD_INVOCATION_ID"] - # ====================== + + # https://github.com/ViaQ/elasticsearch-templates/pull/115 + generated_fields = [item for item in generated_fields if not item["name"] == "viaq_index_name"] + # ====================== # ---- wget print('\nDownloading released index pattern file for comparison:') diff --git a/scripts/compare_against_released_templates_test.py b/scripts/compare_against_released_templates_test.py index a4f4fcf..ae0f8ca 100644 --- a/scripts/compare_against_released_templates_test.py +++ b/scripts/compare_against_released_templates_test.py @@ -86,7 +86,14 @@ def _remove_all_field(data, es_version): _idx_type = supported.index_type_name(es_version) if "_all" in data["mappings"][_idx_type]: del data["mappings"][_idx_type]["_all"] - + + @staticmethod + def _remove_viaq_index_name_field(generated_json, es_version): + # Remove 'viaq_index_name' field. It was introduced after support for ES6.x was added. + # https://github.com/ViaQ/elasticsearch-templates/pull/115 + _idx_type = supported.index_type_name(es_version) + if "viaq_index_name" in generated_json["mappings"][_idx_type]["properties"]: + del generated_json["mappings"][_idx_type]["properties"]["viaq_index_name"] @staticmethod def _generate_json_index_template(args, es_version): @@ -156,11 +163,14 @@ def _support_compare_index_templates(self, es_version, args, json_url): del generated_json["mappings"][_idx_type]["properties"]["systemd"]["properties"]["t"]["properties"]["STREAM_ID"] del generated_json["mappings"][_idx_type]["properties"]["systemd"]["properties"]["t"]["properties"]["SYSTEMD_INVOCATION_ID"] + self._remove_viaq_index_name_field(generated_json, es_version) + elif es_version == supported._es5x: - pass + self._remove_viaq_index_name_field(generated_json, es_version) elif es_version == supported._es6x: self._remove_all_field(generated_json, es_version) + self._remove_viaq_index_name_field(generated_json, es_version) # ====================== generated_index_template = self._sort(generated_json)