Fix App Issue (#17088)

This commit is contained in:
Mohit Yadav 2024-07-19 01:17:03 +05:30 committed by GitHub
parent 28218ec612
commit c7710481b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 17 deletions

View File

@ -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

View File

@ -715,7 +715,8 @@ public class AppResource extends EntityResource<App, AppRepository> {
@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<App, AppRepository> {
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<App, AppRepository> {
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);
}