From ffc9c7705329ee7fba25c5480bee69c453663260 Mon Sep 17 00:00:00 2001 From: tanshaolong Date: Thu, 5 Sep 2024 16:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=90=8C=E6=AD=A5=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../provider/container/TianYiContainerClusterProvider.java | 2 +- .../provider/container/TianYiContainerNodeProvider.java | 2 +- .../bocloud/ctstack/plugin/provider/utils/TyHttpUtils.java | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java index 90b167e1..816aed21 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerClusterProvider.java @@ -56,7 +56,7 @@ public class TianYiContainerClusterProvider extends TianyiProvider { pageNow++; Integer current = returnObj.getInteger("current"); Integer pages = returnObj.getInteger("pages"); - if (current == pages) { + if (pages == 0 || current == pages) { break; } } diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java index bd3667f1..9e5fa9a9 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/container/TianYiContainerNodeProvider.java @@ -109,7 +109,7 @@ public class TianYiContainerNodeProvider extends TianyiProvider { pageNow++; Integer current = returnObj.getInteger("current"); Integer pages = returnObj.getInteger("pages"); - if (current == pages) { + if (pages == 0 || current == pages) { break; } } diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/utils/TyHttpUtils.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/utils/TyHttpUtils.java index 44cb887b..832b4311 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/utils/TyHttpUtils.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/utils/TyHttpUtils.java @@ -37,9 +37,6 @@ public class TyHttpUtils { headersOfAuth.put("hybrid-date", hybridDate); String requestId = UUID.randomUUID().toString().replace("-", ""); headersOfAuth.put("ctyun-hybrid-request-id", requestId); - logger.info("----------------------------------------------------------"); - logger.info(requestId); - logger.info("----------------------------------------------------------"); String forSignature = forSignature(method, headersOfAuth, params); byte[] kdate = kdate(hybridDate, accessKey, secretKey); byte[] signatureBytes = HmacSHA256Util.hmacSHA256(forSignature.getBytes(StandardCharsets.UTF_8), kdate); @@ -52,9 +49,7 @@ public class TyHttpUtils { newHeaders.put("Content-Type", "application/json"); newHeaders.put("hybrid-date", hybridDate); newHeaders.put("ctyun-hybrid-request-id", requestId); - logger.info("----------------------------------------------------------"); - logger.info(requestId); - logger.info("----------------------------------------------------------"); + logger.info("The requestId of Tianyi cloud is " + requestId); newHeaders.put("Hybrid-Authorization", authorization); newHeaders.put("ctUserId", ctUserId);