From 919cf2d397d31d4688d273a453bceaf699a761af Mon Sep 17 00:00:00 2001 From: mhf Date: Tue, 16 Aug 2022 11:14:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BF=E9=87=8C=E4=BA=91=E5=86=85=E7=BD=91co?= =?UTF-8?q?nnectionStr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/multicloud/aliyun/dbinstance.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/multicloud/aliyun/dbinstance.go b/pkg/multicloud/aliyun/dbinstance.go index 964a0a480a..cff9bab57f 100644 --- a/pkg/multicloud/aliyun/dbinstance.go +++ b/pkg/multicloud/aliyun/dbinstance.go @@ -346,12 +346,17 @@ func (rds *SDBInstance) GetInternalConnectionStr() string { return "" } + str := "" for _, net := range rds.netInfo { if net.IPType != "Public" { - return net.ConnectionString + if net.IPType == "Private" { + return net.ConnectionString + } else if net.IPType == "Inner" { + str = net.ConnectionString + } } } - return "" + return str } func (rds *SDBInstance) GetConnectionStr() string {