Skip to content

Commit 2533cc6

Browse files
Merge pull request #10 from trickMin/main
feat: support nacos registry
2 parents d5acd36 + ebcc259 commit 2533cc6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

hango-api-plane-server/src/main/java/org/hango/cloud/service/impl/GatewayServiceImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ private boolean matchType(String type, String name, String registryId) {
299299
if (type.equalsIgnoreCase(Const.SERVICE_TYPE_K8S) && name.endsWith(".svc.cluster.local")) return true;
300300
if (type.equalsIgnoreCase(Const.SERVICE_TYPE_DUBBO) && name.endsWith(".dubbo")) return true;
301301
if (type.equalsIgnoreCase(Const.SERVICE_TYPE_EUREKA) && name.endsWith(".eureka")) return true;
302+
if (type.equalsIgnoreCase(Const.SERVICE_TYPE_NACOS) && name.endsWith(".nacos")) return true;
302303
return false;
303304
}
304305

@@ -307,6 +308,7 @@ public void updateIstioGateway(PortalIstioGatewayDTO portalGateway) {
307308
configManager.updateConfig(Trans.portalGW2GW(portalGateway));
308309
}
309310

311+
310312
@Override
311313
public PortalIstioGatewayDTO getIstioGateway(String clusterName) {
312314
IstioGateway istioGateway = new IstioGateway();

hango-api-plane-server/src/main/java/org/hango/cloud/util/Const.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public interface Const {
2626
String SERVICE_TYPE_K8S = "Kubernetes";
2727
String SERVICE_TYPE_DUBBO = "Zookeeper";
2828
String SERVICE_TYPE_EUREKA = "Eureka";
29-
List<String> VAILD_REGISTRY = Arrays.asList(SERVICE_TYPE_CONSUL, SERVICE_TYPE_K8S, SERVICE_TYPE_DUBBO, SERVICE_TYPE_EUREKA);
29+
30+
String SERVICE_TYPE_NACOS = "Nacos";
31+
List<String> VAILD_REGISTRY = Arrays.asList(SERVICE_TYPE_CONSUL, SERVICE_TYPE_K8S, SERVICE_TYPE_DUBBO, SERVICE_TYPE_EUREKA,SERVICE_TYPE_NACOS);
3032

3133
String PROTOCOL_DUBBO = "dubbo";
3234
String DUBBO_APPLICATION = "application";

0 commit comments

Comments
 (0)