Skip to content

Commit 76379f8

Browse files
committed
Add workaround for issue when concurrently deleting security policies
1 parent b330393 commit 76379f8

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.13 (unreleased)
2+
3+
- Add workaround for issue when concurrently deleting security policy objects where the reference count is not updated
4+
15
## 0.3.12
26

37
- Add `protocol_type` attribute to `sdwan_zone_based_firewall_policy_definition` resource and data source

docs/guides/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ description: |-
77

88
# Changelog
99

10+
## 0.3.13 (unreleased)
11+
12+
- Add workaround for issue when concurrently deleting security policy objects where the reference count is not updated
13+
1014
## 0.3.12
1115

1216
- Add `protocol_type` attribute to `sdwan_zone_based_firewall_policy_definition` resource and data source

gen/definitions/generic/security_policy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ get_rest_endpoint: /template/policy/security/definition/
55
has_version: true
66
id_from_query_path: data
77
id_from_query_path_attribute: policyId
8+
delete_mutex: true
89
doc_category: Security Policies
910
attributes:
1011
- model_name: policyType

internal/provider/resource_sdwan_security_policy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ func (r *SecurityPolicyResource) Delete(ctx context.Context, req resource.Delete
332332

333333
tflog.Debug(ctx, fmt.Sprintf("%s: Beginning Delete", state.Name.ValueString()))
334334

335+
r.updateMutex.Lock()
335336
res, err := r.client.Delete(state.getPath() + url.QueryEscape(state.Id.ValueString()))
337+
r.updateMutex.Unlock()
336338
if err != nil {
337339
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (DELETE), got error: %s, %s", err, res.String()))
338340
return

templates/guides/changelog.md.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ description: |-
77

88
# Changelog
99

10+
## 0.3.13 (unreleased)
11+
12+
- Add workaround for issue when concurrently deleting security policy objects where the reference count is not updated
13+
1014
## 0.3.12
1115

1216
- Add `protocol_type` attribute to `sdwan_zone_based_firewall_policy_definition` resource and data source

0 commit comments

Comments
 (0)