mirror of
https://github.com/hanzoai/ai.git
synced 2026-11-21 02:05:26 +00:00
cluster/ is live application code — /v1/finetune/* and the deploy/undeploy actions reach it — and it genuinely needs cluster state, so this is the seam case rather than the delete case. cluster/k8s.go mirrors cloud-oss/k8s.go: a K8sClient interface, a BuildK8sClient that never returns nil, and an unavailable default that fails closed with a reason. Its error is deliberately NOT one of the sentinels, so "there is no cluster" can never be read as "the object is absent". The factory takes a kubeconfig because this service is multi-cluster — the config comes from the tenant's provider row, not from the pod. cache.go is deleted: 511 lines running six informers over services, deployments, ingresses, nodes, events and namespaces. An application should not hold a replicated mirror of cluster state. View now lists per request, and Describe derives its URL from the view it already built instead of making a second round of reads. The typed k8s.io/api structs stay, decoded from the seam's maps through apimachinery's converter, so every existing status and failure branch is unchanged rather than rewritten. Types are not cluster access. go list -deps finds no client-go. k8s.io/api, apimachinery, metrics (types) and kustomize (renders, never dials) remain. Co-authored-by: Hanzo Dev <[email protected]>