Skip to content

Commit 1ffcf90

Browse files
committed
fix: unable to find ingress by project
1 parent 441f713 commit 1ffcf90

File tree

111 files changed

+25
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+25
-216
lines changed

envoy-infra/src/main/java/org/hango/cloud/envoy/infra/virtualgateway/service/impl/KubernetesGatewayServiceImpl.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import io.fabric8.kubernetes.api.model.gatewayapi.v1beta1.*;
44
import lombok.extern.slf4j.Slf4j;
55
import org.apache.commons.lang3.StringUtils;
6+
import org.apache.commons.lang3.math.NumberUtils;
67
import org.hango.cloud.common.infra.base.errorcode.CommonErrorCode;
78
import org.hango.cloud.common.infra.base.errorcode.ErrorCode;
9+
import org.hango.cloud.common.infra.base.meta.BaseConst;
810
import org.hango.cloud.common.infra.domain.dto.DomainInfoDTO;
911
import org.hango.cloud.common.infra.domain.service.IDomainInfoService;
1012
import org.hango.cloud.common.infra.gateway.dto.GatewayDto;
@@ -146,7 +148,12 @@ public IngressViewDTO getIngress(Long virtualGatewayId) {
146148

147149
@Override
148150
public void fillGatewayInfo(List<KubernetesGatewayInfo> gatewayInfoList) {
149-
return;
151+
for (KubernetesGatewayInfo kubernetesGatewayInfo : gatewayInfoList) {
152+
String projectCode = kubernetesGatewayInfo.getProjectCode();
153+
if (BaseConst.HANGO.equals(projectCode)){
154+
kubernetesGatewayInfo.setProjectId(NumberUtils.LONG_ONE);
155+
}
156+
}
150157
}
151158

152159
private void fillPluginInfo(IngressViewDTO ingressRuleViewDTO, Long virtualGatewayId){

envoy-infra/src/main/resources/schema.sql

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -815,22 +815,23 @@
815815

816816

817817
CREATE TABLE `hango_plugin_binding` (
818-
`id` bigint(11) NOT NULL AUTO_INCREMENT,
819-
`plugin_type` varchar(255) NOT NULL COMMENT '绑定的插件类型,全局唯一,如:RateLimiter、WhiteList等',
820-
`binding_object_type` varchar(255) NOT NULL COMMENT '插件所绑定的对象类型,包含路由规则、服务等',
821-
`binding_object_id` varchar(255) NOT NULL COMMENT '插件所绑定的对象的唯一标识,与binding_object_type共同决定某一具体对象',
822-
`plugin_configuration` text NOT NULL COMMENT '插件配置',
823-
`create_time` bigint(20) NOT NULL COMMENT '最新绑定时间,时间戳格式,精确到毫秒',
824-
`update_time` bigint(20) NOT NULL COMMENT '绑定(配置)修改时间,时间戳格式,精确到毫秒',
825-
`virtual_gw_id` bigint(11) NOT NULL COMMENT '对象-插件绑定关系作用的虚拟网关id',
826-
`project_id` bigint(11) NOT NULL COMMENT '插件绑定关系所属项目id',
827-
`binding_status` varchar(127) NOT NULL DEFAULT 'enable' COMMENT '插件绑定关系状态,enable/disable',
828-
`template_id` bigint(20) DEFAULT '0' COMMENT '关联插件模板id',
829-
`template_version` bigint(20) DEFAULT '0' COMMENT '关联插件模板版本号',
830-
`gw_type` varchar(10) NOT NULL COMMENT '网关类型',
831-
`version` bigint(20) DEFAULT '0' COMMENT '版本号',
832-
PRIMARY KEY (`id`)
833-
) ENGINE=InnoDB AUTO_INCREMENT=252 DEFAULT CHARSET=utf8mb4 COMMENT='插件配置表';
818+
`id` bigint(11) NOT NULL AUTO_INCREMENT,
819+
`plugin_type` varchar(255) NOT NULL COMMENT '绑定的插件类型,全局唯一,如:RateLimiter、WhiteList等',
820+
`plugin_name` varchar(255) DEFAULT NULL COMMENT '绑定的插件名称',
821+
`binding_object_type` varchar(255) NOT NULL COMMENT '插件所绑定的对象类型,包含路由规则、服务等',
822+
`binding_object_id` varchar(255) NOT NULL COMMENT '插件所绑定的对象的唯一标识,与binding_object_type共同决定某一具体对象',
823+
`plugin_configuration` text NOT NULL COMMENT '插件配置',
824+
`create_time` bigint(20) NOT NULL COMMENT '最新绑定时间,时间戳格式,精确到毫秒',
825+
`update_time` bigint(20) NOT NULL COMMENT '绑定(配置)修改时间,时间戳格式,精确到毫秒',
826+
`virtual_gw_id` bigint(11) NOT NULL COMMENT '对象-插件绑定关系作用的虚拟网关id',
827+
`project_id` bigint(11) NOT NULL COMMENT '插件绑定关系所属项目id',
828+
`binding_status` varchar(127) NOT NULL DEFAULT 'enable' COMMENT '插件绑定关系状态,enable/disable',
829+
`template_id` bigint(20) DEFAULT '0' COMMENT '关联插件模板id',
830+
`template_version` bigint(20) DEFAULT '0' COMMENT '关联插件模板版本号',
831+
`gw_type` varchar(10) NOT NULL COMMENT '网关类型',
832+
`version` bigint(20) DEFAULT '0' COMMENT '版本号',
833+
PRIMARY KEY (`id`)
834+
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COMMENT='插件配置表';
834835

835836

836837
CREATE TABLE `hango_plugin_template` (

gateway-api/target/classes/META-INF/services/org.hango.cloud.gdashboard.api.service.IGetProjectIdService

Lines changed: 0 additions & 1 deletion
This file was deleted.
-808 Bytes
Binary file not shown.
-869 Bytes
Binary file not shown.
-350 Bytes
Binary file not shown.
-900 Bytes
Binary file not shown.
-887 Bytes
Binary file not shown.
-701 Bytes
Binary file not shown.
-384 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)