Commit 51bdbaa
refactor(janitor): drop the Node watch + field indexer + predicate
The Node watch existed to self-heal during apply (if a Node update
landed mid-apply we'd re-enqueue and try again) and to detect drift on
released nodes. Both reasons are gone:
* The apply path is one-shot under the node-level lock — we either
succeed and transition Released=True, or the API call propagates an
error and controller-runtime requeues. There's no "we needed another
watch fire to make progress" case.
* Post-release, the external system owns the Node's release state.
ADR-040 is explicit that we do NOT re-take ownership if the external
system strips the taint, and we no longer treat drift as terminal,
so re-enqueueing on Node updates is a no-op.
The watch was firing on every Node taint/label change just to land in
the dispatcher's no-op branch. Net negative: pointless reconcile churn,
40 lines of mapper/predicate/indexer plumbing, an extra RBAC scope
implication.
Removed:
* `Watches(&corev1.Node{}, ...)` from SetupWithManager
* `mapNodeToExtRRs`, `nodeReleaseStateChangedPredicate`,
`indexExtRRByNodeName`, `extrrNodeNameIndexKey`
* The field-indexer registration + `mgr.GetFieldIndexer()` call
* `externalremediationrequest_setup_test.go` (the dedicated test file
for the indexer/predicate/mapper)
* Unused imports: `builder`, `handler`, `predicate`, `event`
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 295d97f commit 51bdbaa
2 files changed
Lines changed: 0 additions & 300 deletions
File tree
- janitor/pkg/controller
Lines changed: 0 additions & 101 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
| |||
70 | 66 | | |
71 | 67 | | |
72 | 68 | | |
73 | | - | |
74 | | - | |
75 | 69 | | |
76 | 70 | | |
77 | 71 | | |
| |||
613 | 607 | | |
614 | 608 | | |
615 | 609 | | |
616 | | - | |
617 | | - | |
618 | 610 | | |
619 | 611 | | |
620 | 612 | | |
| |||
625 | 617 | | |
626 | 618 | | |
627 | 619 | | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | 620 | | |
638 | 621 | | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | 622 | | |
645 | 623 | | |
646 | 624 | | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
652 | | - | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
Lines changed: 0 additions & 199 deletions
This file was deleted.
0 commit comments