fix(services): pass service namespace to init_kong.sh, not DB namespace

services.py run_init_scripts() called init_kong.sh with -n env[NAMESPACE]
where NAMESPACE is the database namespace (e.g. knoe-db). The -n flag
sets COMMON_CORE_NAMESPACE which wins over SERVICE_NAMESPACE in
common_core_resolve_namespace, so Kong deployed into knoe-db.

Fix: resolve kong_ns from SERVICE_NAMESPACE, falling back to
_get_service_namespace() and finally knoe-system. Exclude default
as it is the Tk StringVar initial value, not a real service namespace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
chrisfu 2026-05-03 13:56:34 -07:00
parent 4bcd8f846e
commit c75c63eb9c

View File

@ -809,7 +809,10 @@ class ServicesScreenMixin:
except Exception:
pass
kong_ns = env.get("NAMESPACE") or "knoe-db"
_svc_ns = (env.get("SERVICE_NAMESPACE") or "").strip()
if not _svc_ns or _svc_ns == "default":
_svc_ns = (self._get_service_namespace() or "").strip()
kong_ns = _svc_ns if (_svc_ns and _svc_ns != "default") else "knoe-system"
rc_kong = self.controller.run_script(
script, args=mode_args + ["-n", kong_ns, "start"], env=env, on_line=_kong_line
)