Merged
Conversation
Code Review ✅ ApprovedAdds CRD binding support to zxporter. No issues found. Was this helpful? React with 👍 / 👎 | Gitar |
Tzvonimir
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
● MPA V3: WorkloadRule two-way CRD sync — collector Add/Delete/Update handlers
📚 Description of Changes
Extended the WorkloadRule collector to handle the full CRD lifecycle — AddFunc, DeleteFunc, and spec-change UpdateFunc — so kubectl-applied or CP-pushed CRDs
are reported back to the control plane via SendResourceBatch. Previously the collector only sent on OOM/throttle status changes.
MPA V3 introduces two-way sync between WorkloadRule CRDs and the control plane DB. When a user applies a WorkloadRule via kubectl, the control plane needs to
know about it to create a DB record. When a CRD is deleted from the cluster, the CP needs to clean up. Without these handlers, only OOM events were sent —
spec additions and deletions were silently ignored.
❓ Motivation and Context
Part of the MPA V3 initiative that replaces the policy→target→recommendation model with per-workload WorkloadRule CRDs. The control plane already handles
ingestion of Add/Update/Delete events (RESOURCE_TYPE_WORKLOAD_RULE in metrics_collector.go) — this PR is the zxporter-side counterpart that generates those
events.
Related services PR: crd-binding branch (implements CP ingestion, new optimization policies, deletion flow, and UI)
🔍 Types of Changes
🔬 QA / Verification Steps
✅ Global Checklist