Skip to content

Commit 0146652

Browse files
santhiyanagavsin12
authored andcommitted
Exempted: Bug Fix for Service Mesh
1 parent 66fc078 commit 0146652

16 files changed

+64
-79
lines changed

internal/integrationtest/service_mesh_access_policy_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_access_policy.test_access_policy.id}`},
4242
"mesh_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_mesh.mesh1.id}`},
4343
"name": acctest.Representation{RepType: acctest.Optional, Create: `name`},
44-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
44+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4545
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshAccessPolicyDataSourceFilterRepresentation}}
4646
ServiceMeshAccessPolicyDataSourceFilterRepresentation = map[string]interface{}{
4747
"name": acctest.Representation{RepType: acctest.Required, Create: `id`},
@@ -242,7 +242,7 @@ func TestServiceMeshAccessPolicyResource_basic(t *testing.T) {
242242
resource.TestCheckResourceAttrSet(datasourceName, "id"),
243243
resource.TestCheckResourceAttrSet(datasourceName, "mesh_id"),
244244
resource.TestCheckResourceAttr(datasourceName, "name", "name"),
245-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
245+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
246246
resource.TestCheckResourceAttr(datasourceName, "access_policy_collection.#", "1"),
247247
),
248248
},
@@ -370,8 +370,7 @@ func getServiceMeshAccessPolicyIds(compartment string) ([]string, error) {
370370

371371
listAccessPoliciesRequest := oci_service_mesh.ListAccessPoliciesRequest{}
372372
listAccessPoliciesRequest.CompartmentId = &compartmentId
373-
active := "ACTIVE"
374-
listAccessPoliciesRequest.LifecycleState = &active
373+
listAccessPoliciesRequest.LifecycleState = oci_service_mesh.AccessPolicyLifecycleStateActive
375374
listAccessPoliciesResponse, err := serviceMeshClient.ListAccessPolicies(context.Background(), listAccessPoliciesRequest)
376375

377376
if err != nil {

internal/integrationtest/service_mesh_ingress_gateway_route_table_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_ingress_gateway_route_table.test_ingress_gateway_route_table.id}`},
4040
"ingress_gateway_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_ingress_gateway.ingress_gateway_1.id}`},
4141
"name": acctest.Representation{RepType: acctest.Optional, Create: `name`},
42-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
42+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4343
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshIngressGatewayRouteTableDataSourceFilterRepresentation}}
4444
ServiceMeshIngressGatewayRouteTableDataSourceFilterRepresentation = map[string]interface{}{
4545
"name": acctest.Representation{RepType: acctest.Required, Create: `id`},
@@ -250,10 +250,10 @@ func TestServiceMeshIngressGatewayRouteTableResource_basic(t *testing.T) {
250250
resource.TestCheckResourceAttrSet(datasourceName, "id"),
251251
resource.TestCheckResourceAttrSet(datasourceName, "ingress_gateway_id"),
252252
resource.TestCheckResourceAttr(datasourceName, "name", "name"),
253-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
253+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
254254

255255
resource.TestCheckResourceAttr(datasourceName, "ingress_gateway_route_table_collection.#", "1"),
256-
resource.TestCheckResourceAttr(datasourceName, "ingress_gateway_route_table_collection.0.items.#", "1"),
256+
resource.TestCheckResourceAttr(datasourceName, "ingress_gateway_route_table_collection.0.items.#", "0"),
257257
),
258258
},
259259
// verify singular datasource
@@ -387,8 +387,7 @@ func getServiceMeshIngressGatewayRouteTableIds(compartment string) ([]string, er
387387

388388
listIngressGatewayRouteTablesRequest := oci_service_mesh.ListIngressGatewayRouteTablesRequest{}
389389
listIngressGatewayRouteTablesRequest.CompartmentId = &compartmentId
390-
active := "ACTIVE"
391-
listIngressGatewayRouteTablesRequest.LifecycleState = &active
390+
listIngressGatewayRouteTablesRequest.LifecycleState = oci_service_mesh.IngressGatewayRouteTableLifecycleStateActive
392391
listIngressGatewayRouteTablesResponse, err := serviceMeshClient.ListIngressGatewayRouteTables(context.Background(), listIngressGatewayRouteTablesRequest)
393392

394393
if err != nil {

internal/integrationtest/service_mesh_ingress_gateway_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_ingress_gateway.test_ingress_gateway.id}`},
4242
"mesh_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_mesh.mesh1.id}`},
4343
"name": acctest.Representation{RepType: acctest.Optional, Create: `name`},
44-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
44+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4545
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshIngressGatewayDataSourceFilterRepresentation}}
4646
ServiceMeshIngressGatewayDataSourceFilterRepresentation = map[string]interface{}{
4747
"name": acctest.Representation{RepType: acctest.Required, Create: `id`},
@@ -330,7 +330,7 @@ func TestServiceMeshIngressGatewayResource_basic(t *testing.T) {
330330
resource.TestCheckResourceAttrSet(datasourceName, "id"),
331331
resource.TestCheckResourceAttrSet(datasourceName, "mesh_id"),
332332
resource.TestCheckResourceAttr(datasourceName, "name", "name"),
333-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
333+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
334334

335335
resource.TestCheckResourceAttr(datasourceName, "ingress_gateway_collection.#", "1"),
336336
resource.TestCheckResourceAttr(datasourceName, "ingress_gateway_collection.0.items.#", "0"),
@@ -340,8 +340,7 @@ func TestServiceMeshIngressGatewayResource_basic(t *testing.T) {
340340
{
341341
Config: config +
342342
acctest.GenerateDataSourceFromRepresentationMap("oci_service_mesh_ingress_gateway", "test_ingress_gateway", acctest.Required, acctest.Create, ServiceMeshServiceMeshIngressGatewaySingularDataSourceRepresentation) +
343-
vaultIdVariableStr + keyIdVariableStr + certificateIdVariableStr + certificateAuthorityIdVariableStr + compartmentIdVariableStr + ServiceMeshIngressGatewayResourceDependencies +
344-
acctest.GenerateResourceFromRepresentationMap("oci_service_mesh_ingress_gateway", "test_ingress_gateway", acctest.Optional, acctest.Update, acctest.GetRepresentationCopyWithMultipleRemovedProperties([]string{"hosts.listeners.tls.client_validation.trusted_ca_bundle.ca_bundle_id", "hosts.listeners.tls.server_certificate.certificate_id"}, ServiceMeshIngressGatewayRepresentation)),
343+
vaultIdVariableStr + keyIdVariableStr + certificateIdVariableStr + certificateAuthorityIdVariableStr + compartmentIdVariableStr + ServiceMeshIngressGatewayResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_service_mesh_ingress_gateway", "test_ingress_gateway", acctest.Optional, acctest.Update, acctest.GetRepresentationCopyWithMultipleRemovedProperties([]string{"hosts.listeners.tls.client_validation.trusted_ca_bundle.ca_bundle_id", "hosts.listeners.tls.server_certificate.certificate_id"}, ServiceMeshIngressGatewayRepresentation)),
345344
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
346345
resource.TestCheckResourceAttrSet(singularDatasourceName, "ingress_gateway_id"),
347346

@@ -474,8 +473,7 @@ func getServiceMeshIngressGatewayIds(compartment string) ([]string, error) {
474473

475474
listIngressGatewaysRequest := oci_service_mesh.ListIngressGatewaysRequest{}
476475
listIngressGatewaysRequest.CompartmentId = &compartmentId
477-
active := "ACTIVE"
478-
listIngressGatewaysRequest.LifecycleState = &active
476+
listIngressGatewaysRequest.LifecycleState = oci_service_mesh.IngressGatewayLifecycleStateActive
479477
listIngressGatewaysResponse, err := serviceMeshClient.ListIngressGateways(context.Background(), listIngressGatewaysRequest)
480478

481479
if err != nil {

internal/integrationtest/service_mesh_mesh_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var (
4343
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
4444
"display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`},
4545
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_mesh.test_mesh.id}`},
46-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
46+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4747
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: meshDataSourceFilterRepresentation}}
4848
meshDataSourceFilterRepresentation = map[string]interface{}{
4949
"name": acctest.Representation{RepType: acctest.Required, Create: `id`},
@@ -211,14 +211,14 @@ func TestServiceMeshMeshResource_basic(t *testing.T) {
211211
// verify datasource
212212
{
213213
Config: config +
214-
acctest.GenerateDataSourceFromRepresentationMap("oci_service_mesh_meshes", "test_meshes", acctest.Optional, acctest.Update, ServiceMeshMeshRepresentation) +
214+
acctest.GenerateDataSourceFromRepresentationMap("oci_service_mesh_meshes", "test_meshes", acctest.Optional, acctest.Update, ServiceMeshServiceMeshMeshDataSourceRepresentation) +
215215
compartmentIdVariableStr + ServiceMeshMeshResourceDependencies + certificateAuthorityIdVariableStr +
216216
acctest.GenerateResourceFromRepresentationMap("oci_service_mesh_mesh", "test_mesh", acctest.Optional, acctest.Update, ServiceMeshMeshRepresentation),
217217
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
218218
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
219219
resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"),
220220
resource.TestCheckResourceAttrSet(datasourceName, "id"),
221-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
221+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
222222

223223
resource.TestCheckResourceAttr(datasourceName, "mesh_collection.#", "1"),
224224
resource.TestCheckResourceAttr(datasourceName, "mesh_collection.0.items.#", "0"),
@@ -346,8 +346,7 @@ func getServiceMeshMeshIds(compartment string) ([]string, error) {
346346

347347
listMeshesRequest := oci_service_mesh.ListMeshesRequest{}
348348
listMeshesRequest.CompartmentId = &compartmentId
349-
active := "ACTIVE"
350-
listMeshesRequest.LifecycleState = &active
349+
listMeshesRequest.LifecycleState = oci_service_mesh.MeshLifecycleStateActive
351350
listMeshesResponse, err := serviceMeshClient.ListMeshes(context.Background(), listMeshesRequest)
352351

353352
if err != nil {

internal/integrationtest/service_mesh_virtual_deployment_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var (
4040
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
4141
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_virtual_deployment.test_virtual_deployment.id}`},
4242
"name": acctest.Representation{RepType: acctest.Optional, Create: `name`},
43-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
43+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4444
"virtual_service_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_virtual_service.virtual_service_1.id}`},
4545
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshVirtualDeploymentDataSourceFilterRepresentation}}
4646
ServiceMeshVirtualDeploymentDataSourceFilterRepresentation = map[string]interface{}{
@@ -273,7 +273,7 @@ func TestServiceMeshVirtualDeploymentResource_basic(t *testing.T) {
273273
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
274274
resource.TestCheckResourceAttrSet(datasourceName, "id"),
275275
resource.TestCheckResourceAttr(datasourceName, "name", "name"),
276-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
276+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
277277
resource.TestCheckResourceAttrSet(datasourceName, "virtual_service_id"),
278278

279279
resource.TestCheckResourceAttr(datasourceName, "virtual_deployment_collection.#", "1"),
@@ -405,8 +405,7 @@ func getServiceMeshVirtualDeploymentIds(compartment string) ([]string, error) {
405405

406406
listVirtualDeploymentsRequest := oci_service_mesh.ListVirtualDeploymentsRequest{}
407407
listVirtualDeploymentsRequest.CompartmentId = &compartmentId
408-
active := "ACTIVE"
409-
listVirtualDeploymentsRequest.LifecycleState = &active
408+
listVirtualDeploymentsRequest.LifecycleState = oci_service_mesh.VirtualDeploymentLifecycleStateActive
410409
listVirtualDeploymentsResponse, err := serviceMeshClient.ListVirtualDeployments(context.Background(), listVirtualDeploymentsRequest)
411410

412411
if err != nil {

internal/integrationtest/service_mesh_virtual_service_route_table_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
"compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`},
3939
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_virtual_service_route_table.test_virtual_service_route_table.id}`},
4040
"name": acctest.Representation{RepType: acctest.Optional, Create: `name`},
41-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
41+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4242
"virtual_service_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_virtual_service.virtual_service_1.id}`},
4343
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshVirtualServiceRouteTableDataSourceFilterRepresentation}}
4444
ServiceMeshVirtualServiceRouteTableDataSourceFilterRepresentation = map[string]interface{}{
@@ -237,7 +237,7 @@ func TestServiceMeshVirtualServiceRouteTableResource_basic(t *testing.T) {
237237
resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId),
238238
resource.TestCheckResourceAttrSet(datasourceName, "id"),
239239
resource.TestCheckResourceAttr(datasourceName, "name", "name"),
240-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
240+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
241241
resource.TestCheckResourceAttrSet(datasourceName, "virtual_service_id"),
242242

243243
resource.TestCheckResourceAttr(datasourceName, "virtual_service_route_table_collection.#", "1"),
@@ -372,8 +372,7 @@ func getServiceMeshVirtualServiceRouteTableIds(compartment string) ([]string, er
372372

373373
listVirtualServiceRouteTablesRequest := oci_service_mesh.ListVirtualServiceRouteTablesRequest{}
374374
listVirtualServiceRouteTablesRequest.CompartmentId = &compartmentId
375-
active := "ACTIVE"
376-
listVirtualServiceRouteTablesRequest.LifecycleState = &active
375+
listVirtualServiceRouteTablesRequest.LifecycleState = oci_service_mesh.VirtualServiceRouteTableLifecycleStateActive
377376
listVirtualServiceRouteTablesResponse, err := serviceMeshClient.ListVirtualServiceRouteTables(context.Background(), listVirtualServiceRouteTablesRequest)
378377

379378
if err != nil {

internal/integrationtest/service_mesh_virtual_service_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var (
4141
"id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_virtual_service.test_virtual_service.id}`},
4242
"mesh_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_service_mesh_mesh.mesh1.id}`},
4343
"name": acctest.Representation{RepType: acctest.Optional, Create: `vs-name`},
44-
"state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`},
44+
"state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`},
4545
"filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshVirtualServiceDataSourceFilterRepresentation}}
4646
ServiceMeshVirtualServiceDataSourceFilterRepresentation = map[string]interface{}{
4747
"name": acctest.Representation{RepType: acctest.Required, Create: `id`},
@@ -233,7 +233,7 @@ func TestServiceMeshVirtualServiceResource_basic(t *testing.T) {
233233
resource.TestCheckResourceAttrSet(datasourceName, "id"),
234234
resource.TestCheckResourceAttrSet(datasourceName, "mesh_id"),
235235
resource.TestCheckResourceAttr(datasourceName, "name", "vs-name"),
236-
resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"),
236+
resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"),
237237

238238
resource.TestCheckResourceAttr(datasourceName, "virtual_service_collection.#", "1"),
239239
resource.TestCheckResourceAttr(datasourceName, "virtual_service_collection.0.items.#", "0"),
@@ -364,8 +364,7 @@ func getServiceMeshVirtualServiceIds(compartment string) ([]string, error) {
364364

365365
listVirtualServicesRequest := oci_service_mesh.ListVirtualServicesRequest{}
366366
listVirtualServicesRequest.CompartmentId = &compartmentId
367-
active := "ACTIVE"
368-
listVirtualServicesRequest.LifecycleState = &active
367+
listVirtualServicesRequest.LifecycleState = oci_service_mesh.VirtualServiceLifecycleStateActive
369368
listVirtualServicesResponse, err := serviceMeshClient.ListVirtualServices(context.Background(), listVirtualServicesRequest)
370369

371370
if err != nil {

internal/service/service_mesh/service_mesh_access_policies_data_source.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ func (s *ServiceMeshAccessPoliciesDataSourceCrud) Get() error {
9898
}
9999

100100
if state, ok := s.D.GetOkExists("state"); ok {
101-
tmp := state.(string)
102-
request.LifecycleState = &tmp
101+
request.LifecycleState = oci_service_mesh.AccessPolicyLifecycleStateEnum(state.(string))
103102
}
104103

105104
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "service_mesh")

internal/service/service_mesh/service_mesh_ingress_gateway_resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,8 @@ func CaBundleToMap(obj *oci_service_mesh.CaBundle) map[string]interface{} {
826826
return result
827827
}
828828

829-
func (s *ServiceMeshIngressGatewayResourceCrud) mapToCreateIngressGatewayMutualTransportLayerSecurityDetails(fieldKeyFormat string) (oci_service_mesh.CreateIngressGatewayMutualTransportLayerSecurityDetails, error) {
830-
result := oci_service_mesh.CreateIngressGatewayMutualTransportLayerSecurityDetails{}
829+
func (s *ServiceMeshIngressGatewayResourceCrud) mapToCreateIngressGatewayMutualTransportLayerSecurityDetails(fieldKeyFormat string) (oci_service_mesh.IngressGatewayMutualTransportLayerSecurityDetails, error) {
830+
result := oci_service_mesh.IngressGatewayMutualTransportLayerSecurityDetails{}
831831

832832
if maximumValidity, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "maximum_validity")); ok {
833833
tmp := maximumValidity.(int)

internal/service/service_mesh/service_mesh_ingress_gateway_route_tables_data_source.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ func (s *ServiceMeshIngressGatewayRouteTablesDataSourceCrud) Get() error {
9898
}
9999

100100
if state, ok := s.D.GetOkExists("state"); ok {
101-
tmp := state.(string)
102-
request.LifecycleState = &tmp
101+
request.LifecycleState = oci_service_mesh.IngressGatewayRouteTableLifecycleStateEnum(state.(string))
103102
}
104103

105104
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "service_mesh")

0 commit comments

Comments
 (0)