Skip to content

Commit 563c3fc

Browse files
authored
Releasing version 4.66.0
Releasing version 4.66.0
2 parents 955faec + 1e5ebaf commit 563c3fc

File tree

12,929 files changed

+184568
-178782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

12,929 files changed

+184568
-178782
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 4.66.0 (Unreleased)
2+
3+
### Added
4+
- vcn-route-type option to drg attachment
5+
- match_type MATCH_ALL for drg route distribution statements.
6+
- support for Managed Egress in Notebooks and Jobs
7+
- DBAAS EXACC - Infra Patching V2
8+
- Support for enabling and disable High Availability in active DbSystems (MDS)
9+
- Logging Analytics - Common Scope Filter in Dashboard
10+
111
## 4.65.0 (February 23, 2022)
212

313
### Added

examples/database/exadata_cc/exadata-infrastructure.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ resource "oci_database_exadata_infrastructure" "test_exadata_infrastructure" {
9292
}
9393

9494
weeks_of_month = ["2"]
95+
96+
patching_mode = "ROLLING"
97+
98+
is_custom_action_timeout_enabled = true
99+
100+
custom_action_timeout_in_mins = 30
95101
}
96102

97103
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ require (
6666
github.com/mitchellh/mapstructure v1.1.2 // indirect
6767
github.com/mitchellh/reflectwalk v1.0.1 // indirect
6868
github.com/oklog/run v1.0.0 // indirect
69-
github.com/oracle/oci-go-sdk/v59 v59.0.0
69+
github.com/oracle/oci-go-sdk/v60 v60.0.0
7070
github.com/pmezard/go-difflib v1.0.0 // indirect
7171
github.com/posener/complete v1.2.1 // indirect
7272
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ
295295
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
296296
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
297297
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
298-
github.com/oracle/oci-go-sdk/v59 v59.0.0 h1:+zTvWfj9ZK0OwLRyXjUkZ8dPN3WvkQSRd3iooaOxNVs=
299-
github.com/oracle/oci-go-sdk/v59 v59.0.0/go.mod h1:PWyWRn+xkQxwwmLq/oO03X3tN1tk2vEIE2tFaJmldHM=
298+
github.com/oracle/oci-go-sdk/v60 v60.0.0 h1:EJAWjEi4SY5Raha6iUzq4LTQ0uM5YFw/wat/L1ehIEM=
299+
github.com/oracle/oci-go-sdk/v60 v60.0.0/go.mod h1:krz+2gkSzlSL/L4PvP0Z9pZpag9HYLNtsMd1PmxlA2w=
300300
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
301301
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
302302
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=

internal/acctest/oci_sweeper.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"testing"
1212

1313
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
14-
oci_identity "github.com/oracle/oci-go-sdk/v59/identity"
14+
oci_identity "github.com/oracle/oci-go-sdk/v60/identity"
1515

1616
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
1717

@@ -39,6 +39,10 @@ For example: vcn can have default dhcpOptions, routeTables and securityLists whi
3939
*/
4040
var SweeperDefaultResourceId = make(map[string]bool)
4141

42+
var identityClientListAvailabilityDomains = func(client *oci_identity.IdentityClient, adRequest oci_identity.ListAvailabilityDomainsRequest) (oci_identity.ListAvailabilityDomainsResponse, error) {
43+
return client.ListAvailabilityDomains(context.Background(), adRequest)
44+
}
45+
4246
// issue-routing-tag: terraform/default
4347
func TestMain(m *testing.M) {
4448
resource.TestMain(m)
@@ -79,7 +83,7 @@ func GetAvalabilityDomains(compartmentId string) (map[string]string, error) {
7983
identityClient := GetTestClients(&schema.ResourceData{}).IdentityClient()
8084
adRequest := oci_identity.ListAvailabilityDomainsRequest{}
8185
adRequest.CompartmentId = &compartmentId
82-
ads, err := identityClient.ListAvailabilityDomains(context.Background(), adRequest)
86+
ads, err := identityClientListAvailabilityDomains(identityClient, adRequest)
8387
if err != nil {
8488
return availabilityDomains, fmt.Errorf("Error getting availability domains for compartment id : %s , %s \n", compartmentId, err)
8589
}
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
// Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
package acctest
5+
6+
import (
7+
"errors"
8+
"fmt"
9+
"net/http"
10+
"os"
11+
"reflect"
12+
"testing"
13+
14+
oci_identity "github.com/oracle/oci-go-sdk/v60/identity"
15+
)
16+
17+
func setUp(t *testing.T) {
18+
19+
SweeperResourceCompartmentIdMap = map[string]map[string][]string{"compartment-1_ocid": {
20+
"vcn": []string{"vcn-1_ocid"},
21+
},
22+
}
23+
}
24+
25+
func tearDown(t *testing.T) {
26+
SweeperResourceCompartmentIdMap = map[string]map[string][]string{}
27+
}
28+
29+
func TestUnitAddResourceIdToSweeperResourceIdMap(t *testing.T) {
30+
31+
testsweeperResourceCompartmentIdMapWithCompID := map[string]map[string][]string{
32+
"compartment-1_ocid": {
33+
"vcn": []string{"vcn-1_ocid", "vcn-2_ocid"},
34+
},
35+
}
36+
testsweeperResourceCompartmentIdMapWithNonExistentCompID := map[string]map[string][]string{
37+
"nonexistent_compID": {
38+
"vcn": []string{"vcn-1_ocid"},
39+
},
40+
}
41+
testsweeperResourceCompartmentIdMapWithNonExistentResourceType := map[string]map[string][]string{
42+
"compartment-1_ocid": {
43+
"vcn": []string{"vcn-1_ocid"},
44+
"nonexistent_resource_type": []string{"vcn-1_ocid"},
45+
},
46+
}
47+
48+
type args struct {
49+
compartmentId string
50+
resourceType string
51+
resourceId string
52+
}
53+
54+
tests := []struct {
55+
name string
56+
args args
57+
want map[string]map[string][]string
58+
}{
59+
{
60+
name: "Test with nonexistent value for compartmentId",
61+
args: args{
62+
compartmentId: "nonexistent_compID",
63+
resourceType: "vcn",
64+
resourceId: "vcn-1_ocid",
65+
},
66+
want: testsweeperResourceCompartmentIdMapWithNonExistentCompID,
67+
},
68+
{
69+
name: "Test for existing compartmentId but nonexistent resourceType",
70+
args: args{
71+
compartmentId: "compartment-1_ocid",
72+
resourceType: "nonexistent_resource_type",
73+
resourceId: "vcn-1_ocid",
74+
},
75+
want: testsweeperResourceCompartmentIdMapWithNonExistentResourceType,
76+
},
77+
{
78+
name: "Test for existing compartmentId and resourceType",
79+
args: args{
80+
compartmentId: "compartment-1_ocid",
81+
resourceType: "vcn",
82+
resourceId: "vcn-2_ocid",
83+
},
84+
want: testsweeperResourceCompartmentIdMapWithCompID,
85+
},
86+
}
87+
for _, tt := range tests {
88+
t.Run(tt.name, func(t *testing.T) {
89+
setUp(t)
90+
defer tearDown(t)
91+
AddResourceIdToSweeperResourceIdMap(tt.args.compartmentId, tt.args.resourceType, tt.args.resourceId)
92+
if !reflect.DeepEqual(SweeperResourceCompartmentIdMap, tt.want) {
93+
t.Errorf("AddResourceIdToSweeperResourceIdMap() = %v, want %v", SweeperResourceCompartmentIdMap, tt.want)
94+
}
95+
})
96+
97+
}
98+
99+
}
100+
101+
func TestUnitInSweeperExcludeList(t *testing.T) {
102+
type args struct {
103+
sweeperName string
104+
}
105+
tests := []struct {
106+
name string
107+
args args
108+
want bool
109+
}{
110+
{
111+
name: "sweeperName present in sweep_exclude_list",
112+
args: args{
113+
sweeperName: "EmailSuppression",
114+
},
115+
want: true,
116+
},
117+
{
118+
name: "sweeperName not present in sweep_exclude_list",
119+
args: args{
120+
sweeperName: "AbsentSweeper",
121+
},
122+
want: false,
123+
},
124+
}
125+
for _, tt := range tests {
126+
t.Run(tt.name, func(t *testing.T) {
127+
os.Setenv("sweep_exclude_list", "EmailSuppression,EmailSender,BudgetBudget,AiAnomalyDetectionModel,AiAnomalyDetectionDataAsset,AiAnomalyDetectionProject")
128+
defer os.Unsetenv("sweep_exclude_list")
129+
if got := InSweeperExcludeList(tt.args.sweeperName); got != tt.want {
130+
t.Errorf("InSweeperExcludeList() = %v, want %v", got, tt.want)
131+
}
132+
})
133+
}
134+
135+
}
136+
137+
func TestUnitGetAvalabilityDomains(t *testing.T) {
138+
type args struct {
139+
compartmentId string
140+
}
141+
142+
identityClientListAvailabilityDomains = func(client *oci_identity.IdentityClient, adRequest oci_identity.ListAvailabilityDomainsRequest) (oci_identity.ListAvailabilityDomainsResponse, error) {
143+
Id := "1"
144+
Name := "Domain1"
145+
CompartmentId := "compID"
146+
opcRequestId := "test_opc"
147+
if *adRequest.CompartmentId == "compID" {
148+
return oci_identity.ListAvailabilityDomainsResponse{
149+
OpcRequestId: &opcRequestId,
150+
RawResponse: &http.Response{},
151+
Items: []oci_identity.AvailabilityDomain{{
152+
CompartmentId: &CompartmentId,
153+
Id: &Id,
154+
Name: &Name,
155+
},
156+
},
157+
}, nil
158+
}
159+
return oci_identity.ListAvailabilityDomainsResponse{}, errors.New("invalid compId")
160+
}
161+
162+
tests := []struct {
163+
name string
164+
args args
165+
want map[string]string
166+
wantErr bool
167+
}{
168+
{
169+
name: "Test with valid compartmentID",
170+
args: args{
171+
compartmentId: "compID",
172+
},
173+
174+
want: map[string]string{"1": "Domain1"},
175+
wantErr: false,
176+
},
177+
{
178+
name: "Test with invalid compartmentID",
179+
args: args{
180+
compartmentId: "invalid_compID",
181+
},
182+
want: map[string]string{},
183+
wantErr: true,
184+
},
185+
}
186+
for _, tt := range tests {
187+
t.Run(tt.name, func(t *testing.T) {
188+
got, err := GetAvalabilityDomains(tt.args.compartmentId)
189+
fmt.Println(err)
190+
if (err != nil) != tt.wantErr {
191+
t.Errorf("GetAvalabilityDomains() error = %v, wantErr %v", err, tt.wantErr)
192+
return
193+
}
194+
if !reflect.DeepEqual(got, tt.want) {
195+
t.Errorf("GetAvalabilityDomains() = %v, want %v", got, tt.want)
196+
}
197+
})
198+
}
199+
}
200+
201+
func TestUnitGetResourceIdsToSweep(t *testing.T) {
202+
type args struct {
203+
compartmentId string
204+
resourceName string
205+
}
206+
207+
tests := []struct {
208+
name string
209+
args args
210+
want []string
211+
}{
212+
{
213+
name: "Test for nonexisting compartmentId",
214+
args: args{
215+
compartmentId: "non_existing_compID",
216+
resourceName: "vcn",
217+
},
218+
want: nil,
219+
},
220+
{
221+
name: "Test for existing compartmentId but nonexisting resourceName",
222+
args: args{
223+
compartmentId: "compartment-1_ocid",
224+
resourceName: "non_existing_resource_name",
225+
},
226+
want: nil,
227+
},
228+
{
229+
name: "Test with existing compartmentId and resourceName",
230+
args: args{
231+
compartmentId: "compartment-1_ocid",
232+
resourceName: "vcn",
233+
},
234+
want: []string{"vcn-1_ocid"},
235+
},
236+
}
237+
for _, tt := range tests {
238+
t.Run(tt.name, func(t *testing.T) {
239+
setUp(t)
240+
defer tearDown(t)
241+
if got := GetResourceIdsToSweep(tt.args.compartmentId, tt.args.resourceName); !reflect.DeepEqual(got, tt.want) {
242+
t.Errorf("GetResourceIdsToSweep() = %v, want %v", got, tt.want)
243+
}
244+
})
245+
}
246+
}

internal/acctest/provider_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"testing"
1515
"time"
1616

17-
oci_identity "github.com/oracle/oci-go-sdk/v59/identity"
17+
oci_identity "github.com/oracle/oci-go-sdk/v60/identity"
1818

1919
"github.com/terraform-providers/terraform-provider-oci/internal/globalvar"
2020

@@ -23,7 +23,7 @@ import (
2323
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
2424
"github.com/stretchr/testify/assert"
2525

26-
oci_common "github.com/oracle/oci-go-sdk/v59/common"
26+
oci_common "github.com/oracle/oci-go-sdk/v60/common"
2727

2828
tf_client "github.com/terraform-providers/terraform-provider-oci/internal/client"
2929
"github.com/terraform-providers/terraform-provider-oci/internal/provider"

internal/acctest/test_helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
2929
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
3030
"github.com/hashicorp/terraform-plugin-sdk/terraform"
31-
oci_common "github.com/oracle/oci-go-sdk/v59/common"
31+
oci_common "github.com/oracle/oci-go-sdk/v60/common"
3232

3333
tf_client "github.com/terraform-providers/terraform-provider-oci/internal/client"
3434
tf_provider "github.com/terraform-providers/terraform-provider-oci/internal/provider"
@@ -59,7 +59,7 @@ func TokenizeWithHttpReplay(defaultString string) (string, TokenFn) {
5959
if httpreplay.ModeRecordReplay() {
6060
ts = defaultString
6161
} else {
62-
ts = utils.Timestamp()
62+
ts = tf_resource.Timestamp()
6363
}
6464
return ts, func(template string, values map[string]string) string {
6565
if values == nil {

internal/client/ai_anomaly_detection_clients.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package client
55

66
import (
7-
oci_ai_anomaly_detection "github.com/oracle/oci-go-sdk/v59/aianomalydetection"
7+
oci_ai_anomaly_detection "github.com/oracle/oci-go-sdk/v60/aianomalydetection"
88

9-
oci_common "github.com/oracle/oci-go-sdk/v59/common"
9+
oci_common "github.com/oracle/oci-go-sdk/v60/common"
1010
)
1111

1212
func init() {

internal/client/ai_vision_clients.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package client
55

66
import (
7-
oci_ai_vision "github.com/oracle/oci-go-sdk/v59/aivision"
7+
oci_ai_vision "github.com/oracle/oci-go-sdk/v60/aivision"
88

9-
oci_common "github.com/oracle/oci-go-sdk/v59/common"
9+
oci_common "github.com/oracle/oci-go-sdk/v60/common"
1010
)
1111

1212
func init() {

0 commit comments

Comments
 (0)