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

Method AllOrgStats

controlplane/multitenant.go:65–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64func (p catalogCopierProber) ProbeCNPG(ctx context.Context, shard string) error {
65 if p.cluster == nil {
66 return fmt.Errorf("kubernetes client unavailable")
67 }
68 secretName := "cnpg-" + shard + "-provisioner"
69 secret, err := p.cluster.CoreV1().Secrets("ducklings").Get(ctx, secretName, metav1.GetOptions{})
70 if err != nil {
71 return fmt.Errorf("read shard provisioner credential %s: %w", secretName, err)
72 }
73 endpoint := string(secret.Data["endpoint"])
74 user := string(secret.Data["username"])
75 password := string(secret.Data["password"])
76 port := string(secret.Data["port"])
77 if endpoint == "" || user == "" || password == "" {
78 return fmt.Errorf("shard provisioner credential %s is missing endpoint, username, or password", secretName)
79 }
80 if port != "" {
81 endpoint = net.JoinHostPort(endpoint, port)
82 }
83 return p.Probe(ctx, endpoint, user, "postgres", password, "require")
84}
85
86// orgRouterAdapter wraps OrgRouter to implement both OrgRouterInterface
87// (for the control plane) and admin.OrgStackInfo (for the admin API).
88type orgRouterAdapter struct {
89 router *OrgRouter

Callers

nothing calls this directly

Calls 4

AllStacksMethod · 0.80
SessionCountMethod · 0.80
WorkerCountMethod · 0.80
observeOrgSessionsActiveFunction · 0.70

Tested by

no test coverage detected