Remove referencingWorkloads/referenceCount from config CRD statuses#5631
Open
ChrisJBurns wants to merge 6 commits into
Open
Remove referencingWorkloads/referenceCount from config CRD statuses#5631ChrisJBurns wants to merge 6 commits into
ChrisJBurns wants to merge 6 commits into
Conversation
Remove the ReferencingWorkloads and ReferenceCount status fields from the six config CRDs (MCPOIDCConfig, MCPAuthzConfig, MCPExternalAuthConfig, MCPTelemetryConfig, MCPWebhookConfig, MCPToolConfig) and the machinery that maintained them. After the indexer + stale-scan-removal work, that denormalized list was kept fresh only to power a kubectl printer column — it no longer backs deletion protection, which the finalizer recomputes live via findReferencingWorkloads. - Drop both fields (and the "References" printcolumn markers) from the v1beta1 status structs and the v1alpha1 type markers; regenerate deepcopy. - Remove the status-population paths in Reconcile, the workload watches and their map handlers (which existed only to refresh the list), and the workloadReferenceCount helper. Keep findReferencingWorkloads + the field indexes for the on-demand deletion check, and the DeletionBlocked condition. - Update unit tests and the stale comments in the workload controllers. BREAKING CHANGE: status.referencingWorkloads and status.referenceCount are removed from all six config CRDs. Anything reading those fields (automation, scripts, the kubectl "References" column) will no longer find them. Deletion protection is unchanged. See #5607. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the envtest specs that asserted Status.ReferencingWorkloads / ReferenceCount tracking and pruning (those fields are gone). Deletion-protection coverage is retained, rewritten to assert via the DeletionBlocked condition and object existence rather than the removed list. See #5607. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Regenerate the six config CRDs and crd-api.md after removing the referencingWorkloads/referenceCount status fields and the "References" printer column. See #5607. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5631 +/- ##
==========================================
+ Coverage 70.27% 70.32% +0.04%
==========================================
Files 648 647 -1
Lines 66011 65738 -273
==========================================
- Hits 46391 46231 -160
+ Misses 16279 16159 -120
- Partials 3341 3348 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
WorkloadRefsEqual was the "did the ref list change?" guard before the config status writes removed in this PR. With those callers gone it had no production references (only its own test), the symmetric leftover to the deleted workloadReferenceCount helper. Remove it and its test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The config-CRD sections still described a referencingWorkloads status field. Reword the three references to drop it and note that referrers are recomputed on demand at deletion time (finalizer + field-indexed lookup). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover the full create-ref -> deletion blocked (DeletionBlocked condition) -> remove ref -> deleted transition for MCPExternalAuthConfig, mirroring the ToolConfig/Telemetry suites. With the workload watches removed, unblock now rides the controller's 30s requeue, so the spec allows up to 45s for the config to be garbage-collected after the reference is gone. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Addressed the review findings (commits on top of the original three):
|
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.
Summary
Removes the
status.referencingWorkloadsandstatus.referenceCountfields (and theReferencesprinter column) from the six config CRDs —MCPOIDCConfig,MCPAuthzConfig,MCPExternalAuthConfig,MCPTelemetryConfig,MCPWebhookConfig,MCPToolConfig— and deletes the watch/rebuild machinery that maintained them.After the field-indexer rollout (#5599) and stale-scan removal (#5626), that denormalized list was kept fresh only to populate a
kubectlprinter column. It no longer backs deletion protection: the finalizer recomputes referrers live (findReferencingWorkloads) before allowing deletion. So the stored list was pure overhead — every workload change reconciled the config purely to refresh a count — and this removes it.Completes the cleanup tracked in #5607.
status.referencingWorkloadsandstatus.referenceCountare removed from all six config CRDs. Anyone relying on these status fields for automated workflows — scripts, GitOps assertions, dashboards, or thekubectl get"References" column — will no longer find them. There is no replacement field; if you need the set of referrers, list the workloads and filter by their config-ref. For example: