From 564dfaa8ae7a420189510b9a8b0c85c953981a21 Mon Sep 17 00:00:00 2001 From: zywang Date: Tue, 12 Nov 2024 09:00:13 +0800 Subject: [PATCH] refactor code --- .../service/ProductDeploymentService.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/ProductDeploymentService.java b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/ProductDeploymentService.java index ac2fb1d3..bce280db 100644 --- a/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/ProductDeploymentService.java +++ b/kraken-java-sdk/kraken-java-sdk-controller/src/main/java/com/consoleconnect/kraken/operator/controller/service/ProductDeploymentService.java @@ -429,20 +429,13 @@ private void updateSystemStatus(UnifiedAssetEntity templateDeployment) { templateDeployment.getLabels().getOrDefault(LABEL_APP_TEMPLATE_UPGRADE_ID, ""); UnifiedAssetDto templateUpgrade = unifiedAssetService.findOne(templateUpgradeId); String envName = templateDeployment.getLabels().get(LABEL_ENV_NAME); + String version = templateUpgrade.getMetadata().getLabels().get(LABEL_PRODUCT_VERSION); if (EnvNameEnum.STAGE.name().equalsIgnoreCase(envName)) { systemInfoService.updateProductVersion( - SystemStateEnum.STAGE_UPGRADE_DONE, - null, - Constants.formatVersionUsingV( - templateUpgrade.getMetadata().getLabels().get(LABEL_PRODUCT_VERSION)), - null); + SystemStateEnum.STAGE_UPGRADE_DONE, null, Constants.formatVersionUsingV(version), null); } else { systemInfoService.updateProductVersion( - SystemStateEnum.RUNNING, - null, - null, - Constants.formatVersionUsingV( - templateUpgrade.getMetadata().getLabels().get(LABEL_PRODUCT_VERSION))); + SystemStateEnum.RUNNING, null, null, Constants.formatVersionUsingV(version)); } }