Skip to content

Commit

Permalink
fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-henglu committed May 8, 2024
1 parent c6ae9a9 commit 1fd654e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions resource/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ func Test_NewContextInit(t *testing.T) {
}
}
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
key_vault {
purge_soft_delete_on_destroy = false
purge_soft_deleted_keys_on_destroy = false
}
}
skip_provider_registration = true
}
provider "azapi" {
skip_provider_registration = false
}
Expand Down
6 changes: 3 additions & 3 deletions tf/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewDiffReport(plan *tfjson.Plan, logs []paltypes.RequestTrace) types.DiffRe
continue
}

change := types.Change{}
var change types.Change

if _, ok := beforeMap["body"].(string); ok {
change = types.Change{
Expand Down Expand Up @@ -332,7 +332,7 @@ func NewErrorReport(applyErr error, logs []paltypes.RequestTrace) types.ErrorRep
if applyErr == nil {
return out
}
res := make([]string, 0)
var res []string
if strings.Contains(applyErr.Error(), "Error: Failed to create/update resource") {
res = strings.Split(applyErr.Error(), "Error: Failed to create/update resource")
} else {
Expand Down Expand Up @@ -372,7 +372,7 @@ func NewCleanupErrorReport(applyErr error, logs []paltypes.RequestTrace) types.E
if applyErr == nil {
return out
}
res := make([]string, 0)
var res []string
if strings.Contains(applyErr.Error(), "Error: Failed to delete resource") {
res = strings.Split(applyErr.Error(), "Error: Failed to delete resource")
} else {
Expand Down

0 comments on commit 1fd654e

Please sign in to comment.