Fix Kubernetes namespaces for dotted usernames
Build and publish Docker image / build-and-publish (push) Successful in 8s

This commit is contained in:
wfalkowski committed 2026-10-20 19:38:31 +00:00
1 parent 522e5c5634
commit 6732ee9d47
8 files changed
+70 -19

No files matched your search

+4 -3
View File
@@ -7,6 +7,7 @@ from domain_runtime import domain_manager
import json
from kubernetes.client.rest import ApiException
from kubernetes_service import custom_objects_api, k8s_manager
from namespace_utils import user_namespace
import re
from runtime_config import (
NODE_IP,
@@ -325,7 +326,7 @@ def cleanup_orphaned_ingressroutes():
for domain, username in db_domains.items():
if not domain or not username:
continue
namespace = f"user-{username}".lower()
namespace = user_namespace(username)
subdomain = domain.split('.')[0]
ingressroute_name = f"{subdomain}-ingress"
@@ -590,7 +591,7 @@ def link_domain_to_server(domain_id: str, server_id: str) -> bool:
return False
username = user['username']
namespace = (server.get('namespace') or f"user-{username}").lower()
namespace = server.get('namespace') or user_namespace(username)
domain_host = domain.get('full_domain') or domain.get('domain')
if not domain_host:
logger.error("Domain record has no hostname: %s", domain_id)
@@ -675,7 +676,7 @@ def unlink_domain_from_server(domain_id: str) -> bool:
if user:
username = user['username']
namespace = ((server or {}).get('namespace') or f"user-{username}").lower()
namespace = (server or {}).get('namespace') or user_namespace(username)
# Delete IngressRoute in Kubernetes
if not delete_traefik_ingressroute(domain=domain_host, namespace=namespace):