Skip to content

Commit d41b2e5

Browse files
committed
Bug fix - multiple terminating lifescyle states issue for integration test
1 parent 711d5e7 commit d41b2e5

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

internal/integrationtest/core_public_ip_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ func getCorePublicIpIds(compartment string) ([]string, error) {
532532
func CorePublicIpSweepWaitCondition(response common.OCIOperationResponse) bool {
533533
// Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required.
534534
if publicIpResponse, ok := response.Response.(oci_core.GetPublicIpResponse); ok {
535-
return publicIpResponse.LifecycleState != oci_core.PublicIpLifecycleStateTerminated
535+
return publicIpResponse.LifecycleState != oci_core.PublicIpLifecycleStateUnassigned && publicIpResponse.LifecycleState != oci_core.PublicIpLifecycleStateTerminated
536536
}
537537
return false
538538
}

internal/integrationtest/database_database_software_image_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func getDatabaseDatabaseSoftwareImageIds(compartment string) ([]string, error) {
367367
func DatabaseDatabaseSoftwareImageSweepWaitCondition(response common.OCIOperationResponse) bool {
368368
// Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required.
369369
if databaseSoftwareImageResponse, ok := response.Response.(oci_database.GetDatabaseSoftwareImageResponse); ok {
370-
return (databaseSoftwareImageResponse.LifecycleState != oci_database.DatabaseSoftwareImageLifecycleStateDeleted) && (databaseSoftwareImageResponse.LifecycleState != oci_database.DatabaseSoftwareImageLifecycleStateTerminated)
370+
return databaseSoftwareImageResponse.LifecycleState != oci_database.DatabaseSoftwareImageLifecycleStateDeleted && databaseSoftwareImageResponse.LifecycleState != oci_database.DatabaseSoftwareImageLifecycleStateTerminated
371371
}
372372
return false
373373
}

internal/integrationtest/management_agent_management_agent_install_key_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func getManagementAgentInstallKeyIds(compartment string) ([]string, error) {
309309
func managementAgentInstallKeySweepWaitCondition(response common.OCIOperationResponse) bool {
310310
// Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required.
311311
if managementAgentInstallKeyResponse, ok := response.Response.(oci_management_agent.GetManagementAgentInstallKeyResponse); ok {
312-
return managementAgentInstallKeyResponse.LifecycleState != oci_management_agent.LifecycleStatesTerminated
312+
return managementAgentInstallKeyResponse.LifecycleState != oci_management_agent.LifecycleStatesTerminated && managementAgentInstallKeyResponse.LifecycleState != oci_management_agent.LifecycleStatesDeleted
313313
}
314314
return false
315315
}

internal/integrationtest/management_agent_management_agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ func getManagementAgentIds(compartment string) ([]string, error) {
418418
func managementAgentSweepWaitCondition(response common.OCIOperationResponse) bool {
419419
// Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required.
420420
if managementAgentResponse, ok := response.Response.(oci_management_agent.GetManagementAgentResponse); ok {
421-
return managementAgentResponse.LifecycleState != oci_management_agent.LifecycleStatesTerminated
421+
return managementAgentResponse.LifecycleState != oci_management_agent.LifecycleStatesTerminated && managementAgentResponse.LifecycleState != oci_management_agent.LifecycleStatesDeleted
422422
}
423423
return false
424424
}

internal/integrationtest/operator_access_control_operator_control_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func getOperatorAccessControlOperatorControlIds(compartment string) ([]string, e
385385
func OperatorAccessControlOperatorControlSweepWaitCondition(response common.OCIOperationResponse) bool {
386386
// Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required.
387387
if operatorControlResponse, ok := response.Response.(oci_operator_access_control.GetOperatorControlResponse); ok {
388-
return operatorControlResponse.LifecycleState != oci_operator_access_control.OperatorControlLifecycleStatesDeleted
388+
return operatorControlResponse.LifecycleState != oci_operator_access_control.OperatorControlLifecycleStatesUnassigned && operatorControlResponse.LifecycleState != oci_operator_access_control.OperatorControlLifecycleStatesDeleted
389389
}
390390
return false
391391
}

0 commit comments

Comments
 (0)