From 46f2826f843e7f66e48178467ae03da2ee7bf4e0 Mon Sep 17 00:00:00 2001 From: kuangxiang20240501 <167289548+kuangxiang20240501@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:07:38 +0800 Subject: [PATCH] fix(sdk): check whether mapper exites when query control plane deployment details (#164) * remove unsed logs * add check: mapper key not null --- .../operator/controller/service/TemplateUpgradeService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateUpgradeService.java b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateUpgradeService.java index f0f620c8..5590355c 100644 --- a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateUpgradeService.java +++ b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/TemplateUpgradeService.java @@ -330,7 +330,6 @@ public Paging listTemplateDeployment( public List templateDeploymentDetailsFromControlDeployment( UnifiedAssetDto templateDeployment) { Map> apiUseCases = apiComponentService.findApiUseCase(); - log.info("apiUseCases : {}", JsonToolkit.toJson(apiUseCases)); ControlDeploymentFacet controlDeploymentFacet = UnifiedAsset.getFacets(templateDeployment, ControlDeploymentFacet.class); UpgradeTuple upgradeTuple = controlDeploymentFacet.getUpgradeTuple(); @@ -346,7 +345,8 @@ public List templateDeploymentDetailsFromControlDeployment( .filter(Optional::isPresent) .map(Optional::get) .map(ApiUseCaseDto::getMapperKey) - .filter(t -> !appProperty.getQueryExcludeAssetKeys().contains(t)) + .filter(t -> t != null && !appProperty.getQueryExcludeAssetKeys().contains(t)) + .filter(unifiedAssetRepository::existsByKey) .distinct() .map(this::getMapperTagVOFromDraft) .toList();