mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
- add reusable storage probing subsystem with discovery, bounded probe execution, IO classification, caching, and topology integration - render per-node storage inventory in Cluster Nodes UI and extend installer test coverage for topology/storage behavior - introduce core service operation modules and align actions, milestones, services, and supporting configs/scripts for repair/update workflows - update CNPG/Supabase/database artifacts, placement and port mapping configs, plus related integration tests Co-authored-by: Junie <junie@jetbrains.com>
54 lines
1.2 KiB
Python
54 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from ..context import KnoeContext
|
|
from knoe.core.ops import garage_store as garage_store_ops
|
|
|
|
|
|
def _namespace(ctx: KnoeContext) -> str:
|
|
return ctx.service_namespace or ctx.namespace
|
|
|
|
|
|
def _run(ctx: KnoeContext, action: str) -> int:
|
|
try:
|
|
fn = getattr(garage_store_ops, action)
|
|
fn(
|
|
namespace=_namespace(ctx),
|
|
env=ctx.env,
|
|
project_root=ctx.project_root,
|
|
mode=ctx.mode,
|
|
log=ctx.logger,
|
|
)
|
|
return 0
|
|
except Exception as e:
|
|
ctx.err_logger(f"[garage] {action} failed: {e}")
|
|
return 1
|
|
|
|
|
|
def initialize(ctx: KnoeContext):
|
|
return _run(ctx, "initialize")
|
|
|
|
|
|
def start(ctx: KnoeContext):
|
|
return _run(ctx, "start")
|
|
|
|
|
|
def update(ctx: KnoeContext):
|
|
return _run(ctx, "update")
|
|
|
|
|
|
def restart(ctx: KnoeContext):
|
|
return _run(ctx, "restart")
|
|
|
|
|
|
def stop(ctx: KnoeContext):
|
|
return _run(ctx, "stop")
|
|
|
|
|
|
def status(ctx: KnoeContext):
|
|
try:
|
|
ok = garage_store_ops.status(namespace=_namespace(ctx), env=ctx.env)
|
|
return 0 if ok else 1
|
|
except Exception as e:
|
|
ctx.err_logger(f"[garage] status failed: {e}")
|
|
return 1
|