Skip to content

Commit 872f492

Browse files
authored
Merge pull request #1615 from oracle/v.4.80.1-hotfix
reverted changes to core route table that crashed the provider
2 parents 0ebc76a + 911e002 commit 872f492

File tree

6 files changed

+22
-37
lines changed

6 files changed

+22
-37
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.80.1 (June 16, 2022)
2+
### Bug Fix
3+
- Fixed terraform crash for oci_core_route_table resource
4+
15
## 4.80.0 (June 15, 2022)
26

37
### Added
@@ -9,8 +13,6 @@
913
- ADBD time zone for database service
1014
### Bug Fix
1115
- Mysql - Add return body to UpdateBackup api call
12-
### Notes
13-
- Current customers need to update to latest provider if they are seeing the diff in terraform plan for route-rules without making any change.
1416

1517
## 4.79.0 (June 08, 2022)
1618

examples/networking/route_table/route_table.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ resource "oci_core_route_table" "example_route_table" {
5656
network_entity_id = oci_core_internet_gateway.example_ig.id
5757
}
5858
}
59+

internal/globalvar/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"log"
88
)
99

10-
const Version = "4.80.0"
10+
const Version = "4.80.1"
1111
const ReleaseDate = "2022-06-16"
1212

1313
func PrintVersion() {

internal/service/core/core_route_table_resource.go

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,9 @@ func (s *CoreRouteTableResourceCrud) SetData() error {
345345
s.D.Set("freeform_tags", s.Res.FreeformTags)
346346

347347
routeRules := []interface{}{}
348-
readOnlyRule := "Local VCN Route created by OCI"
349348
for _, item := range s.Res.RouteRules {
350-
if *item.Description == readOnlyRule {
351-
continue
352-
}
353-
routeRules = append(routeRules, CustomRouteRuleMap(item))
349+
routeRules = append(routeRules, RouteRuleToMap(item))
354350
}
355-
356351
s.D.Set("route_rules", schema.NewSet(routeRulesHashCodeForSets, routeRules))
357352

358353
s.D.Set("state", s.Res.LifecycleState)
@@ -419,33 +414,28 @@ func (s *CoreRouteTableResourceCrud) mapToRouteRule(fieldKeyFormat string) (oci_
419414
return result, nil
420415
}
421416

422-
func CustomRouteRuleMap(obj oci_core.RouteRule) map[string]interface{} {
417+
func RouteRuleToMap(obj oci_core.RouteRule) map[string]interface{} {
423418
result := map[string]interface{}{}
424-
readOnlyRule := "Local VCN Route created by OCI"
425-
426-
if *obj.Description != readOnlyRule {
427419

428-
if obj.CidrBlock != nil {
429-
result["cidr_block"] = string(*obj.CidrBlock)
430-
}
420+
if obj.CidrBlock != nil {
421+
result["cidr_block"] = string(*obj.CidrBlock)
422+
}
431423

432-
if obj.Description != nil {
433-
result["description"] = string(*obj.Description)
434-
}
424+
if obj.Description != nil {
425+
result["description"] = string(*obj.Description)
426+
}
435427

436-
if obj.Destination != nil {
437-
result["destination"] = string(*obj.Destination)
438-
}
428+
if obj.Destination != nil {
429+
result["destination"] = string(*obj.Destination)
430+
}
439431

440-
result["destination_type"] = string(obj.DestinationType)
432+
result["destination_type"] = string(obj.DestinationType)
441433

442-
if obj.NetworkEntityId != nil {
443-
result["network_entity_id"] = string(*obj.NetworkEntityId)
444-
}
445-
return result
434+
if obj.NetworkEntityId != nil {
435+
result["network_entity_id"] = string(*obj.NetworkEntityId)
446436
}
447437

448-
return nil
438+
return result
449439
}
450440

451441
func routeRulesHashCodeForSets(v interface{}) int {
@@ -482,7 +472,6 @@ func routeRulesHashCodeForSets(v interface{}) int {
482472
}
483473
return utils.GetStringHashcode(buf.String())
484474
}
485-
486475
func (s *CoreRouteTableResourceCrud) updateCompartment(compartment interface{}) error {
487476
changeCompartmentRequest := oci_core.ChangeRouteTableCompartmentRequest{}
488477

internal/service/core/core_route_tables_data_source.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,9 @@ func (s *CoreRouteTablesDataSourceCrud) SetData() error {
134134
}
135135

136136
routeRules := []interface{}{}
137-
readOnlyRule := "Local VCN Route created by OCI"
138137
for _, item := range r.RouteRules {
139-
if *item.Description == readOnlyRule {
140-
continue
141-
}
142-
routeRules = append(routeRules, CustomRouteRuleMap(item))
138+
routeRules = append(routeRules, RouteRuleToMap(item))
143139
}
144-
145140
routeTable["route_rules"] = routeRules
146141

147142
routeTable["state"] = r.LifecycleState

website/docs/r/core_route_table.html.markdown

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ It does not have to be unique, and you can change it. Avoid entering confidentia
2828

2929
For more information on configuring a VCN's default route table, see [Managing Default VCN Resources](/docs/providers/oci/guides/managing_default_resources.html)
3030

31-
**Note:** Current customers need to update to latest provider if they are seeing the diff in terraform plan for route-rules without making any change.
32-
3331
## Example Usage
3432

3533
```hcl

0 commit comments

Comments
 (0)