From bd61002d9555ab9078e03ade38108a9976a26166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=AF=E8=88=AA?= <101104760+ZhangSetSail@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:17:47 +0800 Subject: [PATCH] fix: create mysql port protocol error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 张启航 <101104760+ZhangSetSail@users.noreply.github.com> --- console/services/market_app/new_components.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/console/services/market_app/new_components.py b/console/services/market_app/new_components.py index a21e71cc7b..bb90d237b9 100644 --- a/console/services/market_app/new_components.py +++ b/console/services/market_app/new_components.py @@ -299,13 +299,16 @@ def _template_to_ports(self, component, ports): k8s_service_name = k8s_service_name + "-" + make_uuid()[:4] except AbortRequest: k8s_service_name = component.service_alias + "-" + str(component_port) + port_protocol = port.get("protocol", "tcp") + if port_protocol not in ["tcp", "udp", "http"]: + port_protocol = "tcp" port = TenantServicesPort( tenant_id=component.tenant_id, service_id=component.service_id, container_port=int(component_port), mapping_port=int(component_port), lb_mapping_port=0, - protocol=port.get("protocol", "tcp"), + protocol=port_protocol, port_alias=port.get("port_alias", ""), is_inner_service=True, is_outer_service=port.get("is_outer_service", False),