Skip to content

Commit

Permalink
rename property
Browse files Browse the repository at this point in the history
  • Loading branch information
lde committed Feb 18, 2021
1 parent 6f45067 commit db40bf2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion azurerm/internal/features/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func Default() UserFeatures {
RecoverSoftDeletedKeyVaults: true,
},
LogAnalyticsWorkspace: LogAnalyticsWorkspaceFeatures{
PermanentDelete: false,
PermanentyDeleteOnDestroy: false,
},
Network: NetworkFeatures{
RelaxedLocking: false,
Expand Down
2 changes: 1 addition & 1 deletion azurerm/internal/features/user_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ type TemplateDeploymentFeatures struct {
}

type LogAnalyticsWorkspaceFeatures struct {
PermanentDelete bool
PermanentyDeleteOnDestroy bool
}
4 changes: 2 additions & 2 deletions azurerm/internal/provider/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions azurerm/internal/provider/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestExpandFeatures(t *testing.T) {
RollInstancesWhenRequired: true,
},
LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{
PermanentDelete: false,
PermanentyDeleteOnDestroy: false,
},
},
},
Expand All @@ -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{}{
Expand Down Expand Up @@ -83,7 +83,7 @@ func TestExpandFeatures(t *testing.T) {
RecoverSoftDeletedKeyVaults: true,
},
LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{
PermanentDelete: true,
PermanentyDeleteOnDestroy: true,
},
Network: features.NetworkFeatures{
RelaxedLocking: true,
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestExpandFeatures(t *testing.T) {
},
"log_analytics_workspace": []interface{}{
map[string]interface{}{
"permanent_delete": false,
"permanently_delete_on_destroy": false,
},
},
},
Expand All @@ -144,7 +144,7 @@ func TestExpandFeatures(t *testing.T) {
RecoverSoftDeletedKeyVaults: false,
},
LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{
PermanentDelete: false,
PermanentyDeleteOnDestroy: false,
},
Network: features.NetworkFeatures{
RelaxedLocking: false,
Expand Down Expand Up @@ -523,7 +523,7 @@ func TestExpandFeaturesLogAnalyticsWorkspace(t *testing.T) {
},
Expected: features.UserFeatures{
LogAnalyticsWorkspace: features.LogAnalyticsWorkspaceFeatures{
PermanentDelete: false,
PermanentyDeleteOnDestroy: false,
},
},
},
Expand All @@ -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,
},
},
},
Expand All @@ -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,
},
},
},
Expand Down

0 comments on commit db40bf2

Please sign in to comment.