Context
client use <id> is a backend-account lookup + local pointer write (client.go runClientUse) — it never touches the cluster, by design. So it succeeds even when the client's cluster is gone (e.g. k3d cluster delete after an i.sh setup): the backend EdgeDevice record still lists, so use happily sets the pointer.
That's the correct behaviour for use (you may select a client to operate on from another machine, or before the cluster is up). The gap is that RFC-0001 §7.3 "'Selected' is not 'connected'" is only half-built:
- Data commands preflight the cluster but don't bind to the active client.
data ingest/list/delete already do cluster.Load→exit 3 / DiscoverParentRelease→exit 4 (data.go:594-620), so a dead cluster errors cleanly. But namespace defaults to the --namespace/context default, not the active client's namespace, and nothing verifies the reached cluster actually hosts the active client. The real hazard is the remote / multi-cluster case: kubeconfig points at a different live cluster than where the active client runs → silent wrong-target, exactly what §7.3 warns about. client list shows no connection state.runClientList prints clients + an (active) marker only. §7.3 wants selected (local pointer) vs connected (🟢 = cluster reachable + recent heartbeat) — that's where a user sees "this client's cluster is gone." ActiveClientID is currently consumed only in auth.go / client.go / doctor.go / config.go — never in the data commands.
cluster doctor (#88, shipped) already gives the health verdict; this ticket wires the active-client ↔ cluster relationship into the everyday commands.
Tasks
Related
Part of tracebloc/backend#830.
Context
client use <id>is a backend-account lookup + local pointer write (client.gorunClientUse) — it never touches the cluster, by design. So it succeeds even when the client's cluster is gone (e.g.k3d cluster deleteafter ani.shsetup): the backendEdgeDevicerecord still lists, sousehappily sets the pointer.That's the correct behaviour for
use(you may select a client to operate on from another machine, or before the cluster is up). The gap is that RFC-0001 §7.3 "'Selected' is not 'connected'" is only half-built:data ingest/list/deletealready docluster.Load→exit 3 /DiscoverParentRelease→exit 4 (data.go:594-620), so a dead cluster errors cleanly. But namespace defaults to the--namespace/context default, not the active client's namespace, and nothing verifies the reached cluster actually hosts the active client. The real hazard is the remote / multi-cluster case: kubeconfig points at a different live cluster than where the active client runs → silent wrong-target, exactly what §7.3 warns about.client listshows no connection state.runClientListprints clients + an(active)marker only. §7.3 wants selected (local pointer) vs connected (🟢 = cluster reachable + recent heartbeat) — that's where a user sees "this client's cluster is gone."ActiveClientIDis currently consumed only in auth.go / client.go / doctor.go / config.go — never in the data commands.cluster doctor(#88, shipped) already gives the health verdict; this ticket wires the active-client ↔ cluster relationship into the everyday commands.Tasks
-nto the active client'snamespace; resolve a reachable kube-context hosting<ns>-jobs-manager(reuseDiscoverParentRelease).--context/-nstill override.Xruns on another machine — rundatacommands there, ortracebloc client usea local one." No silent wrong-target.client listconnected column. Distinguish selected vs connected (🟢 = reachable + recent heartbeat). Needs the backend heartbeat surfaced (RFC-0001 C.4 — coordinate with backend if the heartbeat/last_seenfield isn't on the list payload yet).client use. Non-fatal, bounded-timeout probe:⚠ selected client X, but its cluster isn't reachable from here — run 'tracebloc cluster doctor'. Must NOT hard-failuse(keeps remote/offline selection working).Related
docs/rfcs/0001-cli-auth-and-client-provisioning.md)tracebloc cluster doctor— live-cluster health check with remedies #88 (cluster doctor), CLI quick wins: cluster-connect + kubeconfig-flag helpers, rename sweep, pinned lint + deadcode gate #127 (resolveClusterTargetrefactor — the natural place the binding helper lands)kube-systemUID → re-provision mints a duplicate + orphans the old client with a dead heartbeat). That's R12 offboarding /client delete --uninstall, still un-ticketed — separate issue.Part of tracebloc/backend#830.