Sanitize metadata.labels in direct controllers via label.GCPLabels #15528
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 277 lines diff across 3 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.337
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #15528"
general
weight: 0.35
anhdle-sso
Several direct controllers copied raw Kubernetes
metadata.labels(GetLabels()) or manual map entries directly into GCP resource protobuf messages without sanitization. When GitOps tools such as Config Sync, Helm, or ArgoCD inject standard Kubernetes labels containing.or/(e.g.app.kubernetes.io/managed-by), GCP APIs rejectCreateandUpdaterequests with HTTP 400.This PR standardizes label handling across affected direct controllers using the canonical
label.GCPLabels(obj)helper, which strips KRM-prefixed keys and appliesmanaged-by-cnrm: "true".Key Changes
label.GCPLabels(obj):-
NetworkSecurityAuthzPolicy(pkg/controller/direct/networksecurity)-
NetworkServicesServiceBinding(pkg/controller/direct/networkservices)-
ConfigDeliveryResourceBundle(pkg/controller/direct/configdelivery)-
DataprocBatch(pkg/controller/direct/dataproc)-
DataprocSession(pkg/controller/direct/dataproc)-
DataprocSessionTemplate(pkg/controller/direct/dataproc/dataprocsessiontemplate)-
WorkflowsExecution(pkg/controller/direct/workflowexecutions)-
DataprocCluster(pkg/controller/direct/dataproc)-
ConfigDeliveryFleetPackage(pkg/controller/direct/configdelivery/configdeliveryfleetpackage)CloudDeployDeployPolicy(pkg/controller/direct/clouddeploy/clouddeploydeploypolicy), sanitized labels vialabel.GCPLabels(u), populateddesiredPb.Labels, and preserved GCP system labels (goog-,go-) duringUpdate.managed-by-cnrmare preserved.Fixes #15439
``
release-note
``Sanitize metadata.labels in direct controllers via label.GCPLabels to strip Kubernetes-specific label keys and prevent API rejection.
This pull request was generated by an AI coding agent.
<sub>🤖 Agent session</sub>
<!-- factory:task-output kind=Change task=recipe-fix-20261112-220622-7b1f -->