From 3aec47ef17650cc77a6879cdb1cf7a8dd48dc97a Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Thu, 9 Jun 2022 17:29:38 +0200 Subject: [PATCH 1/5] Extends the list of tested versions --- .ci/pipelines/acceptance.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/pipelines/acceptance.groovy b/.ci/pipelines/acceptance.groovy index babc91f77..cf8923e2f 100644 --- a/.ci/pipelines/acceptance.groovy +++ b/.ci/pipelines/acceptance.groovy @@ -11,7 +11,7 @@ pipeline { axes { axis { name 'ES_VERSION' - values '8.0.0', '7.15.1' + values '7.11.2', '7.12.1', '7.13.4', '7.14.2', '7.15.2', '7.16.3', '7.17.4', '8.0.1', '8.1.3', '8.2.2' } } agent { label('linux && immutable && docker') } From c6df838a91e9b8290c8cf78694bcd269c55d5ca9 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Fri, 17 Jun 2022 15:43:43 +0200 Subject: [PATCH 2/5] Remove default media_type attribute in Append processor --- internal/elasticsearch/ingest/processor_append_data_source.go | 3 +-- internal/models/ingest.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/elasticsearch/ingest/processor_append_data_source.go b/internal/elasticsearch/ingest/processor_append_data_source.go index 1dad6cad5..0a2128d41 100644 --- a/internal/elasticsearch/ingest/processor_append_data_source.go +++ b/internal/elasticsearch/ingest/processor_append_data_source.go @@ -40,10 +40,9 @@ func DataSourceProcessorAppend() *schema.Resource { Default: true, }, "media_type": { - Description: "The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`.", + Description: "The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. Supported only from Elasticsearch version **7.15**.", Type: schema.TypeString, Optional: true, - Default: "application/json", }, "description": { Description: "Description of the processor. ", diff --git a/internal/models/ingest.go b/internal/models/ingest.go index f11e8616d..0c70aa3b1 100644 --- a/internal/models/ingest.go +++ b/internal/models/ingest.go @@ -28,7 +28,7 @@ type ProcessorAppend struct { Field string `json:"field"` Value []string `json:"value"` AllowDuplicates bool `json:"allow_duplicates"` - MediaType string `json:"media_type"` + MediaType string `json:"media_type,omitempty"` } type ProcessorBytes struct { From 2af7005b8fcdb024ff4f711a1a43ba6123c92aff Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Fri, 17 Jun 2022 16:16:31 +0200 Subject: [PATCH 3/5] Adjust TestAccDataSourceIngestProcessorAppend --- .../elasticsearch/ingest/processor_append_data_source_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/elasticsearch/ingest/processor_append_data_source_test.go b/internal/elasticsearch/ingest/processor_append_data_source_test.go index 3a84ca80a..52d9a1eca 100644 --- a/internal/elasticsearch/ingest/processor_append_data_source_test.go +++ b/internal/elasticsearch/ingest/processor_append_data_source_test.go @@ -27,8 +27,7 @@ const expectedJsonAppend = `{ "append": { "field": "tags", "value": ["production", "{{{app}}}", "{{{owner}}}"], - "allow_duplicates": true, - "media_type": "application/json", + "allow_duplicates": true, "description": "Append tags to the doc", "ignore_failure": false } From 599fff6a845e64b309d7ae8069e87dd2f00a371f Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Wed, 22 Jun 2022 15:14:16 +0200 Subject: [PATCH 4/5] Regenerate docs --- docs/data-sources/elasticsearch_ingest_processor_append.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data-sources/elasticsearch_ingest_processor_append.md b/docs/data-sources/elasticsearch_ingest_processor_append.md index c0ff6bbb5..c556abed8 100644 --- a/docs/data-sources/elasticsearch_ingest_processor_append.md +++ b/docs/data-sources/elasticsearch_ingest_processor_append.md @@ -48,7 +48,7 @@ resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" { - **description** (String) Description of the processor. - **if** (String) Conditionally execute the processor - **ignore_failure** (Boolean) Ignore failures for the processor. -- **media_type** (String) The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. +- **media_type** (String) The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. Supported only from Elasticsearch version **7.15**. - **on_failure** (List of String) Handle failures for the processor. - **tag** (String) Identifier for the processor. From c546336a07a446ba3d45a5957090087baafca079 Mon Sep 17 00:00:00 2001 From: Thibault Richard Date: Wed, 22 Jun 2022 15:18:34 +0200 Subject: [PATCH 5/5] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eec8d1858..6dc63f0a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [Unreleased] ### Fixed - Correctly identify a missing security user ([#101](https://github.com/elastic/terraform-provider-elasticstack/issues/101)) +- Support **7.x** Elasticsearch < **7.15** by removing the default `media_type` attribute in the Append processor ([#118](https://github.com/elastic/terraform-provider-elasticstack/pull/118)) ## [0.3.3] - 2023-03-22 ### Fixed