Skip to content

Commit

Permalink
fix: gateway domain split "-" (#1466)
Browse files Browse the repository at this point in the history
Signed-off-by: 逆流而上 <[email protected]>
  • Loading branch information
DokiDoki1103 authored May 31, 2024
1 parent b5801d7 commit 58a3142
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion console/services/app_config/domain_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,8 @@ def create_default_gateway_rule(self, tenant, region_info, service, port):
service_id = service.service_id
service_name = service.service_alias
container_port = port.container_port
domain_name = str(service_name) + "." + str(region_info.httpdomain)
domain_name = str(service_name) + "-" + str(container_port) + "-" + str(tenant.tenant_name) + "-" + str(
region_info.httpdomain)
create_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
protocol = "http"
http_rule_id = make_uuid(domain_name)
Expand Down
5 changes: 3 additions & 2 deletions console/services/app_config/port_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def __open_outer(self, tenant, service, region, deal_port, user_name='', app=Non
if deal_port.protocol == "http":
service_name = service.service_alias
container_port = deal_port.container_port
domain_name = str(service_name) + "." + str(region.httpdomain)
domain_name = str(service_name) + "-" + str(container_port) + "-" + str(tenant.tenant_name) + "-" + str(region.httpdomain)
protocol = "http"
service_id = service.service_id
http_rule_id = make_uuid(domain_name)
Expand All @@ -488,7 +488,8 @@ def __open_outer(self, tenant, service, region, deal_port, user_name='', app=Non
service_id = service.service_id
service_name = service.service_alias
container_port = deal_port.container_port
domain_name = str(service_name) + "." + str(region.httpdomain)
domain_name = str(service_name) + "-" + str(container_port) + "-" + str(tenant.tenant_name) + "-" + str(
region.httpdomain)
domain_repo.create_service_domains(service_id, service_name, domain_name, create_time, container_port, protocol,
http_rule_id, tenant_id, service_alias, region_id)

Expand Down
3 changes: 2 additions & 1 deletion console/services/groupapp_recovery/groupapps_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ def __save_port(self,
service_id = service.service_id
service_name = service.service_alias
container_port = port.container_port
domain_name = str(service_name) + "." + str(region.httpdomain)
domain_name = str(service_name) + "-" + str(container_port) + "-" + str(
tenant.tenant_name) + "-" + str(region.httpdomain)
create_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
protocol = "http"
http_rule_id = make_uuid(domain_name)
Expand Down
3 changes: 1 addition & 2 deletions console/services/market_app/new_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,7 @@ def _contains_default_rule(rules: [ServiceDomain]):
return False

def _create_default_domain(self, service_alias: str, port: int):
return str(service_alias) + "." + str(self.region.httpdomain)
# return str(port) + "." + service_alias + "." + self.tenant.tenant_name + "." + self.region.httpdomain
return service_alias + "-" + str(port) + "-" + self.tenant.tenant_name + "-" + self.region.httpdomain

@staticmethod
def _domain_cookie_or_header(items):
Expand Down

0 comments on commit 58a3142

Please sign in to comment.