Skip to content

Commit

Permalink
fix: create mysql port protocol error (#1521)
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail authored Nov 14, 2024
1 parent 185138c commit 043c3af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion console/services/market_app/new_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 043c3af

Please sign in to comment.