@GET @Path("/delete-deployments") public void deleteDeployments() { LOG.warn("user {} is deleting all integration deploymets", context.getRemoteUser()); List<Integration> integrations = dataMgr.fetchAll(Integration.class).getItems(); for (Integration i : integrations) { if (openShiftService.exists(i.getName())) { openShiftService.delete(i.getName()); LOG.debug("Deleting integration \"{}\"", i.getName()); } else { LOG.debug("Skipping integration named \"{}\". No such deployment found.", i.getName()); } } }
@Override public StateUpdate execute(IntegrationDeployment integrationDeployment) { IntegrationDeploymentState currentState = !openShiftService().exists(integrationDeployment.getName()) || openShiftService().delete(integrationDeployment.getName()) ? IntegrationDeploymentState.Undeployed : IntegrationDeploymentState.Pending; logInfo(integrationDeployment,"Deleted"); return new StateUpdate(currentState); }
@Override public StateUpdate execute(IntegrationDeployment integrationDeployment) { IntegrationDeploymentState currentState = !openShiftService().exists(integrationDeployment.getSpec().getName()) || openShiftService().delete(integrationDeployment.getSpec().getName()) ? IntegrationDeploymentState.Unpublished : IntegrationDeploymentState.Pending; if (currentState == IntegrationDeploymentState.Unpublished) { logInfo(integrationDeployment,"Deleted"); IntegrationDeployment updated = new IntegrationDeployment.Builder().createFrom(integrationDeployment).addAllStepsDone(Collections.emptyList()).build(); dataManager.update(updated); } return new StateUpdate(currentState); }