diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java index f92d546dbde..378333cdbc7 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java @@ -63,8 +63,9 @@ public class AbstractNativeApplication implements NativeApplication { @Override public void install() { // If the app does not have any Schedule Return without scheduling - if (app.getAppSchedule() != null - && app.getAppSchedule().getScheduleTimeline().equals(ScheduleTimeline.NONE)) { + if (Boolean.FALSE.equals(app.getDeleted()) + || (app.getAppSchedule() != null + && app.getAppSchedule().getScheduleTimeline().equals(ScheduleTimeline.NONE))) { return; } if (app.getAppType() == AppType.Internal diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java index e30a9b218bb..7cf4705987e 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java @@ -715,7 +715,8 @@ public class AppResource extends EntityResource { @Parameter(description = "Name of the App", schema = @Schema(type = "string")) @PathParam("name") String name) { - App app = repository.getByName(null, name, repository.getFields("bot,pipelines")); + App app = + repository.getByName(uriInfo, name, repository.getFields("bot,pipelines"), ALL, false); if (app.getSystem()) { throw new IllegalArgumentException( CatalogExceptionMessage.systemEntityDeleteNotAllowed(app.getName(), "SystemApp")); @@ -748,7 +749,7 @@ public class AppResource extends EntityResource { boolean hardDelete, @Parameter(description = "Id of the App", schema = @Schema(type = "UUID")) @PathParam("id") UUID id) { - App app = repository.get(null, id, repository.getFields("bot,pipelines")); + App app = repository.get(uriInfo, id, repository.getFields("bot,pipelines"), ALL, false); if (app.getSystem()) { throw new IllegalArgumentException( CatalogExceptionMessage.systemEntityDeleteNotAllowed(app.getName(), "SystemApp")); @@ -1054,19 +1055,7 @@ public class AppResource extends EntityResource { ingestionPipelineRepository.get( null, pipelineRef.getId(), ingestionPipelineRepository.getFields(FIELD_OWNER)); try { - if (hardDelete) { - // Remove the Pipeline in case of Delete - if (!nullOrEmpty(installedApp.getPipelines())) { - pipelineServiceClient.deletePipeline(ingestionPipeline); - } - } else { - // Just Kill Running ingestion - if (Boolean.TRUE.equals(ingestionPipeline.getDeployed())) { - decryptOrNullify( - securityContext, ingestionPipeline, installedApp.getBot().getName(), true); - pipelineServiceClient.killIngestion(ingestionPipeline); - } - } + pipelineServiceClient.deletePipeline(ingestionPipeline); } catch (Exception ex) { LOG.error("Failed in Pipeline Service Client : ", ex); }