From db40bf295a595bd310efdaa1ef21501f537b286c Mon Sep 17 00:00:00 2001 From: Lilian Deloche Date: Thu, 18 Feb 2021 21:39:16 +0100 Subject: [PATCH] rename property --- azurerm/internal/features/defaults.go | 2 +- azurerm/internal/features/user_flags.go | 2 +- azurerm/internal/provider/features.go | 4 ++-- azurerm/internal/provider/features_test.go | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/azurerm/internal/features/defaults.go b/azurerm/internal/features/defaults.go index ed014c0241691..81bea4d9b5b60 100644 --- a/azurerm/internal/features/defaults.go +++ b/azurerm/internal/features/defaults.go @@ -8,7 +8,7 @@ func Default() UserFeatures { RecoverSoftDeletedKeyVaults: true, }, LogAnalyticsWorkspace: LogAnalyticsWorkspaceFeatures{ - PermanentDelete: false, + PermanentyDeleteOnDestroy: false, }, Network: NetworkFeatures{ RelaxedLocking: false, diff --git a/azurerm/internal/features/user_flags.go b/azurerm/internal/features/user_flags.go index ff84d41bba5b7..57d0e427e3542 100644 --- a/azurerm/internal/features/user_flags.go +++ b/azurerm/internal/features/user_flags.go @@ -32,5 +32,5 @@ type TemplateDeploymentFeatures struct { } type LogAnalyticsWorkspaceFeatures struct { - PermanentDelete bool + PermanentyDeleteOnDestroy bool } diff --git a/azurerm/internal/provider/features.go b/azurerm/internal/provider/features.go index 8d943442d9f6a..e2240e3ccca0f 100644 --- a/azurerm/internal/provider/features.go +++ b/azurerm/internal/provider/features.go @@ -151,8 +151,8 @@ func expandFeatures(input []interface{}) features.UserFeatures { items := raw.([]interface{}) if len(items) > 0 { logAnalyticsWorkspaceRaw := items[0].(map[string]interface{}) - if v, ok := logAnalyticsWorkspaceRaw["permanent_delete"]; ok { - features.LogAnalyticsWorkspace.PermanentDelete = v.(bool) + if v, ok := logAnalyticsWorkspaceRaw["permanently_delete_on_destroy"]; ok { + features.LogAnalyticsWorkspace.PermanentyDeleteOnDestroy = v.(bool) } } } diff --git a/azurerm/internal/provider/features_test.go b/azurerm/internal/provider/features_test.go index 9c7c64694d9c4..bf10c4afe8399 100644 --- a/azurerm/internal/provider/features_test.go +++ b/azurerm/internal/provider/features_test.go @@ -35,7 +35,7 @@ func TestExpandFeatures(t *testing.T) { RollInstancesWhenRequired: true, }, LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ - PermanentDelete: false, + PermanentyDeleteOnDestroy: false, }, }, }, @@ -51,7 +51,7 @@ func TestExpandFeatures(t *testing.T) { }, "log_analytics_workspace": []interface{}{ map[string]interface{}{ - "permanent_delete": true, + "permanently_delete_on_destroy": true, }, }, "network": []interface{}{ @@ -83,7 +83,7 @@ func TestExpandFeatures(t *testing.T) { RecoverSoftDeletedKeyVaults: true, }, LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ - PermanentDelete: true, + PermanentyDeleteOnDestroy: true, }, Network: features.NetworkFeatures{ RelaxedLocking: true, @@ -133,7 +133,7 @@ func TestExpandFeatures(t *testing.T) { }, "log_analytics_workspace": []interface{}{ map[string]interface{}{ - "permanent_delete": false, + "permanently_delete_on_destroy": false, }, }, }, @@ -144,7 +144,7 @@ func TestExpandFeatures(t *testing.T) { RecoverSoftDeletedKeyVaults: false, }, LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ - PermanentDelete: false, + PermanentyDeleteOnDestroy: false, }, Network: features.NetworkFeatures{ RelaxedLocking: false, @@ -523,7 +523,7 @@ func TestExpandFeaturesLogAnalyticsWorkspace(t *testing.T) { }, Expected: features.UserFeatures{ LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ - PermanentDelete: false, + PermanentyDeleteOnDestroy: false, }, }, }, @@ -533,14 +533,14 @@ func TestExpandFeaturesLogAnalyticsWorkspace(t *testing.T) { map[string]interface{}{ "log_analytics_workspace": []interface{}{ map[string]interface{}{ - "permanent_delete": true, + "permanently_delete_on_destroy": true, }, }, }, }, Expected: features.UserFeatures{ LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ - PermanentDelete: true, + PermanentyDeleteOnDestroy: true, }, }, }, @@ -550,14 +550,14 @@ func TestExpandFeaturesLogAnalyticsWorkspace(t *testing.T) { map[string]interface{}{ "log_analytics_workspace": []interface{}{ map[string]interface{}{ - "permanent_delete": false, + "permanently_delete_on_destroy": false, }, }, }, }, Expected: features.UserFeatures{ LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{ - PermanentDelete: false, + PermanentyDeleteOnDestroy: false, }, }, },