ha: support GKE Fleet Connect Gateway kubeconfig contexts in ha setup and ha status #16593
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.66) × (1 − Review Confidence (0.54)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 389 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.357
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #16593"
general
weight: 0.35
acpana
This pull request was generated by an AI coding agent.
Summary
Support GKE Fleet Connect Gateway kubeconfig contexts in
config-connector ha setupandconfig-connector ha status.Key Changes
resolveGKEClusterhelper (pkg/cli/cmd/ha/gke_context.go):- Fast path (zero API calls): Direct parsing of
gke_<project>_<location>_<cluster>from context name, with a fallback to the underlying kubeconfigcontext.clustername to supportkubectl config rename-contextaliases.- Connect Gateway path: Detects Connect Gateway endpoint URLs matching
https://([a-z0-9-]+-)?connectgateway\.googleapis\.com/v[^/]+/projects/([^/]+)/locations/([^/]+)/gkeMemberships/([^/]+)on the REST client config Host (or kubeconfig server URL). Queriesgcloud container fleet memberships describe <membership> --location=<memLoc> --project=<fleetProj> --format=jsonviarunner.outputto extract the authoritativeendpoint.gkeCluster.resourceLink.- Validation & normalization: Rejects non-GKE / attached Fleet clusters with a clear error indicating that multi-cluster HA requires GKE clusters. If
<proj>inresourceLinkis a numeric project number, resolves it to the GCP project ID viagcloud projects describe <proj> --format='value(projectId)'so GSA emails, Workload Identity bindings, andgkeClusterremain consistent.ha status(pkg/cli/cmd/ha/status.go):- Removed the upfront
parseGKEContextloop instatusOptions.validate(), keeping runtime errors aftercmd.SilenceUsage = trueso Cobra usage text is not dumped on context resolution failures.- In
inspectCluster, prefersConfigConnector.spec.experiments.multiClusterLease.gkeClusterwhen the cluster is reachable and configured (zero extragcloudcalls).- Falls back to
resolveGKEClusterwhen a cluster is unreachable or unconfigured soPROJECT,LOCATION, andclusterIdentity()remain accurate, avoiding false "leader outside--contexts" errors when a Connect Gateway cluster is down.ha setup(pkg/cli/cmd/ha/cluster_configurer.go,setup.go):- Passes
commandRunnerintonewClusterConfigurerand usesresolveGKEClusterto resolve cluster coordinates. Read-only describe commands run viarunner.outputwithout mutations in--dry-runand--yaml-only.- Added tests in
gke_context_test.gocovering fast paths, regional/global Connect Gateway URLs, numeric project normalization, cross-project Fleet hosts, and non-GKE cluster rejection.- Added tests in
setup_test.goverifying setup over Connect Gateway (including--dry-runand--yaml-only).- Added tests in
status_test.goverifying zero-gcloudstatus checks on healthy clusters, fallback resolution on unreachable clusters, andcmd.SilenceUsagebehavior.Fixes #16592
``
release-note
``NONE
<sub>🤖 Agent session</sub>
<!-- factory:task-output kind=Change task=recipe-fix-20261128-050751-3311 -->