fix: fix get gateway config in tsf ipv6. (#1747)

pull/1752/head
shedfreewu 3 weeks ago committed by Haotian Zhang
parent 4830ec823d
commit dbc2c7762a

@ -28,3 +28,5 @@
- [test:add junit tests to sct-gw-plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/1732) - [test:add junit tests to sct-gw-plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/1732)
- [feat:compatible metadata transfer with TSF SDK version 1.x.](https://github.com/Tencent/spring-cloud-tencent/pull/1736) - [feat:compatible metadata transfer with TSF SDK version 1.x.](https://github.com/Tencent/spring-cloud-tencent/pull/1736)
- [fix: tsf gateway config support tsf-data-access.](https://github.com/Tencent/spring-cloud-tencent/pull/1745) - [fix: tsf gateway config support tsf-data-access.](https://github.com/Tencent/spring-cloud-tencent/pull/1745)
- [fix: fix multiple bugs in tsf.](https://github.com/Tencent/spring-cloud-tencent/pull/1746)
- [fix: fix get gateway config in tsf ipv6.](https://github.com/Tencent/spring-cloud-tencent/pull/1747)

@ -35,6 +35,7 @@ import com.ecwid.consul.v1.ConsulRawClient;
import com.tencent.cloud.common.util.JacksonUtils; import com.tencent.cloud.common.util.JacksonUtils;
import com.tencent.cloud.polaris.context.PolarisSDKContextManager; import com.tencent.cloud.polaris.context.PolarisSDKContextManager;
import com.tencent.polaris.api.utils.CollectionUtils; import com.tencent.polaris.api.utils.CollectionUtils;
import com.tencent.polaris.api.utils.IPAddressUtils;
import com.tencent.polaris.api.utils.StringUtils; import com.tencent.polaris.api.utils.StringUtils;
import com.tencent.polaris.client.util.NamedThreadFactory; import com.tencent.polaris.client.util.NamedThreadFactory;
import com.tencent.polaris.factory.config.global.ServerConnectorConfigImpl; import com.tencent.polaris.factory.config.global.ServerConnectorConfigImpl;
@ -115,7 +116,7 @@ public class GatewayConsulRepo {
String address = connectorConfig.getAddresses().get(0); String address = connectorConfig.getAddresses().get(0);
int lastIndex = address.lastIndexOf(":"); int lastIndex = address.lastIndexOf(":");
String agentHost = address.substring(0, lastIndex); String agentHost = IPAddressUtils.getIpCompatible(address.substring(0, lastIndex));
int agentPort = Integer.parseInt(address.substring(lastIndex + 1)); int agentPort = Integer.parseInt(address.substring(lastIndex + 1));
logger.info("Connect to consul config server : [{}].", address); logger.info("Connect to consul config server : [{}].", address);

Loading…
Cancel
Save