MCPcopy Create free account
hub / github.com/PostHog/duckgres / registerClusterAPI

Function registerClusterAPI

controlplane/admin/cluster.go:47–56  ·  view source on GitHub ↗

registerClusterAPI wires the read-only cluster-topology endpoints. It is only called when a kubernetes client is available (remote/k8s backend); the process/standalone backends have no cluster to introspect.

(r *gin.RouterGroup, client kubernetes.Interface)

Source from the content-addressed store, hash-verified

45// called when a kubernetes client is available (remote/k8s backend); the
46// process/standalone backends have no cluster to introspect.
47func registerClusterAPI(r *gin.RouterGroup, client kubernetes.Interface) {
48 h := &clusterHandler{client: client}
49 r.GET("/cluster/nodes", h.nodes)
50 r.GET("/cluster/pods", h.pods)
51 r.GET("/cluster/events", h.events)
52 r.GET("/cluster/nodepools", h.nodepools)
53 // Aggregated cluster totals for the admin nav (shown on every page, not just
54 // the Nodes view) — computed server-side so no page needs the full pod list.
55 r.GET("/cluster/summary", h.summary)
56}
57
58// --- projection types: the minimal K8s-shaped subset the node view reads ---
59

Callers 3

clusterTestRouterFunction · 0.85
RegisterExtrasFunction · 0.85

Calls

no outgoing calls

Tested by 2

clusterTestRouterFunction · 0.68