mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 20:06:19 +00:00
Fix App Issue (#17088)
This commit is contained in:
parent
28218ec612
commit
c7710481b5
@ -63,8 +63,9 @@ public class AbstractNativeApplication implements NativeApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void install() {
|
public void install() {
|
||||||
// If the app does not have any Schedule Return without scheduling
|
// If the app does not have any Schedule Return without scheduling
|
||||||
if (app.getAppSchedule() != null
|
if (Boolean.FALSE.equals(app.getDeleted())
|
||||||
&& app.getAppSchedule().getScheduleTimeline().equals(ScheduleTimeline.NONE)) {
|
|| (app.getAppSchedule() != null
|
||||||
|
&& app.getAppSchedule().getScheduleTimeline().equals(ScheduleTimeline.NONE))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (app.getAppType() == AppType.Internal
|
if (app.getAppType() == AppType.Internal
|
||||||
|
@ -715,7 +715,8 @@ public class AppResource extends EntityResource<App, AppRepository> {
|
|||||||
@Parameter(description = "Name of the App", schema = @Schema(type = "string"))
|
@Parameter(description = "Name of the App", schema = @Schema(type = "string"))
|
||||||
@PathParam("name")
|
@PathParam("name")
|
||||||
String 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()) {
|
if (app.getSystem()) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
CatalogExceptionMessage.systemEntityDeleteNotAllowed(app.getName(), "SystemApp"));
|
CatalogExceptionMessage.systemEntityDeleteNotAllowed(app.getName(), "SystemApp"));
|
||||||
@ -748,7 +749,7 @@ public class AppResource extends EntityResource<App, AppRepository> {
|
|||||||
boolean hardDelete,
|
boolean hardDelete,
|
||||||
@Parameter(description = "Id of the App", schema = @Schema(type = "UUID")) @PathParam("id")
|
@Parameter(description = "Id of the App", schema = @Schema(type = "UUID")) @PathParam("id")
|
||||||
UUID 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()) {
|
if (app.getSystem()) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
CatalogExceptionMessage.systemEntityDeleteNotAllowed(app.getName(), "SystemApp"));
|
CatalogExceptionMessage.systemEntityDeleteNotAllowed(app.getName(), "SystemApp"));
|
||||||
@ -1054,19 +1055,7 @@ public class AppResource extends EntityResource<App, AppRepository> {
|
|||||||
ingestionPipelineRepository.get(
|
ingestionPipelineRepository.get(
|
||||||
null, pipelineRef.getId(), ingestionPipelineRepository.getFields(FIELD_OWNER));
|
null, pipelineRef.getId(), ingestionPipelineRepository.getFields(FIELD_OWNER));
|
||||||
try {
|
try {
|
||||||
if (hardDelete) {
|
pipelineServiceClient.deletePipeline(ingestionPipeline);
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOG.error("Failed in Pipeline Service Client : ", ex);
|
LOG.error("Failed in Pipeline Service Client : ", ex);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user