From 65823493a9b1996596d61dfa522f4f44d7f10360 Mon Sep 17 00:00:00 2001 From: Yun Liu Date: Wed, 15 Mar 2023 11:08:53 +0800 Subject: [PATCH 1/2] change language extensions to TypeSet to suppress diff caused by same extensions in different order --- internal/services/kusto/kusto_cluster_resource.go | 4 ++-- internal/services/kusto/kusto_cluster_resource_test.go | 2 -- .../kusto/migration/kusto_cluster_migration_v0_to_v1.go | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/services/kusto/kusto_cluster_resource.go b/internal/services/kusto/kusto_cluster_resource.go index 75fa2a40e98d..6dd1b23bfc04 100644 --- a/internal/services/kusto/kusto_cluster_resource.go +++ b/internal/services/kusto/kusto_cluster_resource.go @@ -167,7 +167,7 @@ func resourceKustoCluster() *pluginsdk.Resource { }, "language_extensions": { - Type: pluginsdk.TypeList, + Type: pluginsdk.TypeSet, Optional: true, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, @@ -377,7 +377,7 @@ func resourceKustoClusterCreateUpdate(d *pluginsdk.ResourceData, meta interface{ d.SetId(id.ID()) if v, ok := d.GetOk("language_extensions"); ok { - languageExtensions := expandKustoClusterLanguageExtensions(v.([]interface{})) + languageExtensions := expandKustoClusterLanguageExtensions(v.(*pluginsdk.Set).List()) currentLanguageExtensions, err := client.ListLanguageExtensions(ctx, id) if err != nil { diff --git a/internal/services/kusto/kusto_cluster_resource_test.go b/internal/services/kusto/kusto_cluster_resource_test.go index fcc52f3c10ae..2aeb29e257d3 100644 --- a/internal/services/kusto/kusto_cluster_resource_test.go +++ b/internal/services/kusto/kusto_cluster_resource_test.go @@ -251,8 +251,6 @@ func TestAccKustoCluster_languageExtensions(t *testing.T) { Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), check.That(data.ResourceName).Key("language_extensions.#").HasValue("2"), - check.That(data.ResourceName).Key("language_extensions.0").HasValue("PYTHON"), - check.That(data.ResourceName).Key("language_extensions.1").HasValue("R"), ), }, data.ImportStep(), diff --git a/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go b/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go index 2d7e643c1c56..9cf3def08541 100644 --- a/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go +++ b/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go @@ -148,7 +148,7 @@ func (s KustoAttachedClusterV0ToV1) Schema() map[string]*pluginsdk.Schema { }, "language_extensions": { - Type: pluginsdk.TypeList, + Type: pluginsdk.TypeSet, Optional: true, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString, From e064ee6625f78470f554e9c544ff1d87989cdd43 Mon Sep 17 00:00:00 2001 From: Yun Liu Date: Mon, 20 Mar 2023 09:38:36 +0800 Subject: [PATCH 2/2] Update internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go Co-authored-by: Tom Harvey --- .../kusto/migration/kusto_cluster_migration_v0_to_v1.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go b/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go index 9cf3def08541..2d7e643c1c56 100644 --- a/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go +++ b/internal/services/kusto/migration/kusto_cluster_migration_v0_to_v1.go @@ -148,7 +148,7 @@ func (s KustoAttachedClusterV0ToV1) Schema() map[string]*pluginsdk.Schema { }, "language_extensions": { - Type: pluginsdk.TypeSet, + Type: pluginsdk.TypeList, Optional: true, Elem: &pluginsdk.Schema{ Type: pluginsdk.TypeString,