()
| 63 | |
| 64 | func (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). |
| 88 | type orgRouterAdapter struct { |
| 89 | router *OrgRouter |
nothing calls this directly
no test coverage detected