Skip to content

Commit

Permalink
add CHANGELOG note
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Oct 24, 2021
1 parent 2853a8b commit 2d9152a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/1257.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_load_balancer: handle empty `rules` for `resourceCloudflareLoadBalancerStateUpgradeV1`
```
3 changes: 1 addition & 2 deletions cloudflare/resource_cloudflare_load_balancer_migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cloudflare

import (
"context"
"reflect"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
Expand Down Expand Up @@ -54,7 +53,7 @@ func resourceCloudflareLoadBalancerV0() *schema.Resource {
}

func resourceCloudflareLoadBalancerStateUpgradeV1(_ context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
if !reflect.ValueOf(rawState["rules"]).IsNil() {
if rawState["rules"] != nil {
for i := range rawState["rules"].([]interface{}) {
rawState["rules"].([]interface{})[i].(map[string]interface{})["fixed_response"] = []interface{}{rawState["rules"].([]interface{})[i].(map[string]interface{})["fixed_response"]}
}
Expand Down

0 comments on commit 2d9152a

Please sign in to comment.