Skip to content

Commit e89c9f7

Browse files
committed
updated static_routes to be empty in oci_core_ipsec resource
1 parent 39a1d1f commit e89c9f7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
- Support resource discovery for `dataflow` resources
1414
- Added `oci_dns_rrset` resource to support DNS RRSet
1515

16+
### Fixed
17+
- updated `static_routes` attribute to be empty in `oci_core_ipsec` resource
18+
1619
## 3.79.0 (June 03, 2020)
1720

1821
### Added

oci/core_ipsec_resource.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func (s *CoreIpSecConnectionResourceCrud) Create() error {
216216
request.FreeformTags = objectMapToStringMap(freeformTags.(map[string]interface{}))
217217
}
218218

219+
request.StaticRoutes = []string{}
219220
if staticRoutes, ok := s.D.GetOkExists("static_routes"); ok {
220221
interfaces := staticRoutes.([]interface{})
221222
tmp := make([]string, len(interfaces))
@@ -224,9 +225,7 @@ func (s *CoreIpSecConnectionResourceCrud) Create() error {
224225
tmp[i] = interfaces[i].(string)
225226
}
226227
}
227-
if len(tmp) != 0 || s.D.HasChange("static_routes") {
228-
request.StaticRoutes = tmp
229-
}
228+
request.StaticRoutes = tmp
230229
}
231230

232231
request.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "core")
@@ -298,6 +297,7 @@ func (s *CoreIpSecConnectionResourceCrud) Update() error {
298297
tmp := s.D.Id()
299298
request.IpscId = &tmp
300299

300+
request.StaticRoutes = []string{}
301301
if staticRoutes, ok := s.D.GetOkExists("static_routes"); ok {
302302
interfaces := staticRoutes.([]interface{})
303303
tmp := make([]string, len(interfaces))
@@ -306,9 +306,7 @@ func (s *CoreIpSecConnectionResourceCrud) Update() error {
306306
tmp[i] = interfaces[i].(string)
307307
}
308308
}
309-
if len(tmp) != 0 || s.D.HasChange("static_routes") {
310-
request.StaticRoutes = tmp
311-
}
309+
request.StaticRoutes = tmp
312310
}
313311

314312
request.RequestMetadata.RetryPolicy = getRetryPolicy(s.DisableNotFoundRetries, "core")

0 commit comments

Comments
 (0)