Skip to content

Commit

Permalink
Merge pull request #1925 from turbomaze/turbomaze/fix-zone-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobbednarz committed Sep 27, 2022
2 parents a14b049 + 4c09210 commit 8f76096
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/1925.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_zone_settings_override: Fix array manipulation bug related to single zone settings
```
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,11 @@ func updateSingleZoneSettings(ctx context.Context, zoneSettings []cloudflare.Zon
}
}

offset := 0
for _, indexToCut := range indexesToCut {
zoneSettings = append(zoneSettings[:indexToCut], zoneSettings[indexToCut+1:]...)
adjustedIndexToCut := indexToCut - offset
zoneSettings = append(zoneSettings[:adjustedIndexToCut], zoneSettings[adjustedIndexToCut+1:]...)
offset += 1
}
return zoneSettings, nil
}
Expand Down

0 comments on commit 8f76096

Please sign in to comment.