Expose configuration for event collection mode #3642
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.75) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.75 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.075
Real PR Conversation Timeline
1 comments
"Review active on #3642"
general
weight: 0.35
gabedos
What does this PR do?
Adds a collectionMode field (poll|watch) to the event collection feature, mapped to the kubernetes_apiserver check's event_collection_mode option. "watch" streams events through a single persistent reflector-backed watch instead of re-opening a watch on every check run.
Motivation
Expose a new agent configuration.
Minimum Agent Versions
Describe your test plan
Tested on minikube (Kubernetes v1.37.0, containerd 2.3.4) with an operator image built from this branch. Each scenario was checked by running
agent configcheckin the Cluster Agent, where thekubernetes_apiservercheck runs.Default (no
collectionMode)<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSexisting behavior is unchanged: no ConfigMap, and the check runs from the image default.collectionMode: poll<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSan explicitpollis treated like the default: no ConfigMap, and the Cluster Agent isn't restarted.collectionMode: watch<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSevent_collection_mode: watchreaches the check and the Cluster Agent logs no config errors.unbundleEventsonly (nocollectionMode)<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSthe unbundled-events ConfigMap is the same as before this change, with noevent_collection_modekey. An empty value would make the Cluster Agent reject the config.collectionMode: watchwithunbundleEvents<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSwatch mode and unbundled events are both in the same check config.collectionMode: watch, Cluster Agent < 7.81.1<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSwatch is not enabled on an unsupported Cluster Agent, and the operator's logs include the configuration error.collectionMode: watch, Cluster Agent = 7.81.1<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSthe minimum-version boundary is inclusive, and the 7.81.1 check runs[OK]with watch mode.Invalid
collectionMode<details>
<summary> Supporting configuration </summary>
</details>
<details>
<summary> Proof</summary>
</details>
Outcome:
PASSCRD enum validation rejects invalid values before they reach the operator.Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits