mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
UI screens - database.py: fix mode detection to use env_key priority (prod→k8s, service→k3s) so stale DEPLOYMENT_MODE never overrides the user's chosen environment - database.py: Registry status reads ARTIFACT_REGISTRY_AVAILABLE persisted by cluster screen; uses SERVICE_NAMESPACE for Artifact Registry repo name - cluster.py: add Artifact Registry traffic light (amber→green/red) to prod section; _check_artifact_registry_async persists ARTIFACT_REGISTRY_AVAILABLE into Global cfg - cluster.py: re-trigger Artifact Registry check after GKE cluster selection so the light re-evaluates once region is available from KUBECONTEXT - cluster_nodes.py: fix TclError on Python 3.14 — pady=(2,0) tuple → pady=2 scalar - __init__.py: seed knoe-system namespace when saved value is "default", not only when empty - services.py: replace hardcoded "Prole DB" log string with dynamic cnpg_cluster name Core ops - cloudnative_pg.py: replace one-shot Barman plugin retry with 6-attempt loop; first cert-manager/x509 failure triggers rollout restart + 30 s CA propagation wait; subsequent failures back off up to 60 s per attempt - cloudnative_pg.py: TLS CA CN now uses cluster_name instead of hardcoded "Prole CNPG CA" - registry.py, garage_store.py: refactored into per-mode modules (k3d/k3s/k8s registry and garage store, shared _garage_common) Deploy / config - deploy/gcp/gke/knoe-db.yaml: GKE-specific CNPG cluster manifest (rw/ro/r on separate nodes with premium-rwo storage) - etc/init_common_services.sh, modes/k8s/knoe-db/.version: updated for current deploy - kong-deployment.yaml: updated manifest Tests - test_cluster_nodes_render_smoke.py: add pack/grid, winfo_children, winfo_reqheight, update_idletasks, grid_slaves to dummy widgets; monkeypatch tk.Label so CNPG placement render completes without a real Tkinter root Co-authored-by: Junie <junie@jetbrains.com>
96 lines
2.3 KiB
Python
96 lines
2.3 KiB
Python
"""Registry ops — thin dispatcher.
|
|
|
|
Routes to the mode-specific implementation:
|
|
k3d → k3d_registry (k3d built-in or Docker fallback)
|
|
k3s → k3s_registry (in-cluster Deployment + Service)
|
|
k8s → k8s_registry (GCP Artifact Registry — no in-cluster registry)
|
|
|
|
All public function signatures are unchanged.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
from types import ModuleType
|
|
|
|
from ._services_common import _LogFn, _detect_mode
|
|
|
|
|
|
def _module(mode: str | None, env: dict | None) -> ModuleType:
|
|
m = _detect_mode(mode, env)
|
|
if m == "k3d":
|
|
from . import k3d_registry
|
|
return k3d_registry
|
|
if m == "k8s":
|
|
from . import k8s_registry
|
|
return k8s_registry
|
|
from . import k3s_registry
|
|
return k3s_registry
|
|
|
|
|
|
def initialize(
|
|
*,
|
|
namespace: str | None = None,
|
|
env: dict | None = None,
|
|
project_root: str | Path = ".",
|
|
log: _LogFn | None = None,
|
|
mode: str | None = None,
|
|
) -> None:
|
|
_module(mode, env).initialize(
|
|
namespace=namespace, env=env, project_root=project_root, log=log, mode=mode
|
|
)
|
|
|
|
|
|
def start(
|
|
*,
|
|
namespace: str | None = None,
|
|
env: dict | None = None,
|
|
project_root: str | Path = ".",
|
|
log: _LogFn | None = None,
|
|
mode: str | None = None,
|
|
) -> None:
|
|
_module(mode, env).start(
|
|
namespace=namespace, env=env, project_root=project_root, log=log, mode=mode
|
|
)
|
|
|
|
|
|
def update(
|
|
*,
|
|
namespace: str | None = None,
|
|
env: dict | None = None,
|
|
project_root: str | Path = ".",
|
|
log: _LogFn | None = None,
|
|
mode: str | None = None,
|
|
) -> None:
|
|
_module(mode, env).update(
|
|
namespace=namespace, env=env, project_root=project_root, log=log, mode=mode
|
|
)
|
|
|
|
|
|
def stop(
|
|
*,
|
|
namespace: str | None = None,
|
|
env: dict | None = None,
|
|
mode: str | None = None,
|
|
log: _LogFn | None = None,
|
|
) -> None:
|
|
_module(mode, env).stop(namespace=namespace, env=env, mode=mode, log=log)
|
|
|
|
|
|
def restart(
|
|
*,
|
|
namespace: str | None = None,
|
|
env: dict | None = None,
|
|
mode: str | None = None,
|
|
log: _LogFn | None = None,
|
|
) -> None:
|
|
_module(mode, env).restart(namespace=namespace, env=env, mode=mode, log=log)
|
|
|
|
|
|
def status(
|
|
*,
|
|
namespace: str | None = None,
|
|
env: dict | None = None,
|
|
mode: str | None = None,
|
|
) -> bool:
|
|
return _module(mode, env).status(namespace=namespace, env=env, mode=mode)
|