diff --git a/patches/0001-fork.patch b/patches/0001-Add-support-for-deprecated-and-removed-http_endpoint.patch similarity index 57% rename from patches/0001-fork.patch rename to patches/0001-Add-support-for-deprecated-and-removed-http_endpoint.patch index 9d62f75c..3a405790 100644 --- a/patches/0001-fork.patch +++ b/patches/0001-Add-support-for-deprecated-and-removed-http_endpoint.patch @@ -1,7 +1,44 @@ -diff --git b/internal/provider/resource_kafka_topic.go a/internal/provider/resource_kafka_topic.go +From 370769e695bbad71cdf775c497940044f20a7edd Mon Sep 17 00:00:00 2001 +From: Ramon Quitales +Date: Thu, 24 Aug 2023 10:00:27 -0700 +Subject: [PATCH 1/2] Add support for deprecated and removed http_endpoint + field + +--- + internal/provider/data_source_kafka_topic.go | 7 +++++ + internal/provider/resource_kafka_topic.go | 28 ++++++++++++++++---- + internal/provider/state_upgraders.go | 13 ++++----- + 3 files changed, 37 insertions(+), 11 deletions(-) + +diff --git a/internal/provider/data_source_kafka_topic.go b/internal/provider/data_source_kafka_topic.go +index b952f18..378d791 100644 +--- a/internal/provider/data_source_kafka_topic.go ++++ b/internal/provider/data_source_kafka_topic.go +@@ -17,6 +17,7 @@ package provider + import ( + "context" + "fmt" ++ + "github.com/hashicorp/terraform-plugin-log/tflog" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +@@ -31,6 +32,12 @@ func kafkaTopicDataSource() *schema.Resource { + Type: schema.TypeString, + Required: true, + }, ++ paramHttpEndpoint: { ++ Deprecated: "This parameter has been deprecated in favour of Rest Endpoint", ++ Type: schema.TypeString, ++ Optional: true, ++ Computed: true, ++ }, + paramRestEndpoint: { + Type: schema.TypeString, + Required: true, +diff --git a/internal/provider/resource_kafka_topic.go b/internal/provider/resource_kafka_topic.go index 459471d..90e6b7f 100644 ---- b/internal/provider/resource_kafka_topic.go -+++ a/internal/provider/resource_kafka_topic.go +--- a/internal/provider/resource_kafka_topic.go ++++ b/internal/provider/resource_kafka_topic.go @@ -18,15 +18,16 @@ import ( "context" "encoding/json" @@ -63,11 +100,23 @@ index 459471d..90e6b7f 100644 } d.SetId(createKafkaTopicId(c.clusterId, topicName)) -diff --git b/internal/provider/state_upgraders.go a/internal/provider/state_upgraders.go -index 4d3ed5b..b6be930 100644 ---- b/internal/provider/state_upgraders.go -+++ a/internal/provider/state_upgraders.go -@@ -88,11 +88,11 @@ func kafkaResourceV0() *schema.Resource { +diff --git a/internal/provider/state_upgraders.go b/internal/provider/state_upgraders.go +index 4d3ed5b..43323da 100644 +--- a/internal/provider/state_upgraders.go ++++ b/internal/provider/state_upgraders.go +@@ -16,9 +16,10 @@ package provider + + import ( + "context" ++ "regexp" ++ + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" +- "regexp" + ) + + func kafkaResourceV0() *schema.Resource { +@@ -88,11 +89,11 @@ func kafkaResourceV0() *schema.Resource { // Modifies the attribute(s) appropriately for the migration. func kafkaStateUpgradeV0(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { // 1. When upgrading from 0.10.0, rename "http_endpoint" to "rest_endpoint" by copying the value and deleting "http_endpoint" attribute @@ -76,11 +125,14 @@ index 4d3ed5b..b6be930 100644 - rawState[paramRestEndpoint] = httpEndpointString - delete(rawState, paramHttpEndpoint) - } -+ //if httpEndpoint, found := rawState[paramHttpEndpoint]; found { -+ // httpEndpointString := httpEndpoint.(string) -+ // rawState[paramRestEndpoint] = httpEndpointString -+ // delete(rawState, paramHttpEndpoint) -+ //} ++ // if httpEndpoint, found := rawState[paramHttpEndpoint]; found { ++ // httpEndpointString := httpEndpoint.(string) ++ // rawState[paramRestEndpoint] = httpEndpointString ++ // delete(rawState, paramHttpEndpoint) ++ // } // 2. When upgrading from 0.11.0 no changes are necessary: "rest_endpoint" exists already return rawState, nil +-- +2.39.2 (Apple Git-143) + diff --git a/patches/0002-Insert-shim.patch b/patches/0002-Insert-shim.patch index e300b9b8..294f82bf 100644 --- a/patches/0002-Insert-shim.patch +++ b/patches/0002-Insert-shim.patch @@ -1,7 +1,7 @@ -From 9ddb67b10e34b449fa8c442447e2005f2879868a Mon Sep 17 00:00:00 2001 +From 1ccb7127739cf3a3a6dbe124f1937cd4b4fcdbe1 Mon Sep 17 00:00:00 2001 From: Ian Wahbe Date: Thu, 9 Mar 2023 18:22:25 +0100 -Subject: [PATCH] Insert shim +Subject: [PATCH 2/2] Insert shim --- shim/shim.go | 10 ++++++++++ @@ -25,5 +25,5 @@ index 0000000..ac43027 + return provider.New(version, customUserAgent)() +} -- -2.39.1 +2.39.2 (Apple Git-143)