Skip to content

Commit

Permalink
purge to be executed always irrespective of the destroy state.
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroopar committed Dec 1, 2023
1 parent 28c6f53 commit 0978665
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,8 @@ private void purgeService(Deployment deployment, DeployTask deployTask,
deployTask.getId());
destroy(deployment, deployTask, deployServiceEntity);
}
DeployServiceEntity updatedDeployServiceEntity =
deployServiceStorage.findDeployServiceById(deployServiceEntity.getId());
if (Objects.nonNull(updatedDeployServiceEntity)
&& ServiceDeploymentState.DESTROY_SUCCESS
== updatedDeployServiceEntity.getServiceDeploymentState()) {
deployServiceStorage.deleteDeployService(deployServiceEntity);
log.info("Database entry with ID {} purged.", deployServiceEntity.getId());
}
deployServiceStorage.deleteDeployService(deployServiceEntity);
log.info("Database entry with ID {} purged.", deployServiceEntity.getId());
} catch (RuntimeException e) {
log.error("Error purging created resources for service with ID: {}. Ignoring.",
deployTask.getId(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void testDeployer() throws Exception {
Assertions.assertNotNull(newServiceDetails);
Assertions.assertEquals(ServiceDeploymentState.DEPLOY_SUCCESS,
newServiceDetails.getServiceDeploymentState());
Assertions.assertTrue(newServiceDetails.getDeployedServiceProperties().size() >= 1);
Assertions.assertFalse(newServiceDetails.getDeployedServiceProperties().isEmpty());

testDestroyAndGetDetails(newServiceId);
} else {
Expand All @@ -95,6 +95,7 @@ void testDeployer() throws Exception {
if (serviceIsTargetState(serviceId, ServiceDeploymentState.DEPLOY_FAILED)) {
testPurgeAndGetDetails(serviceId);
}

}
} else {
if (serviceIsTargetState(serviceId, ServiceDeploymentState.DEPLOY_FAILED)) {
Expand Down

0 comments on commit 0978665

Please sign in to comment.