Commit 320b90b
Add finalizer and reconcileDelete to InstanceHA controller
The controller calls EnsureServiceTopology which places a finalizer on
the referenced Topology CR, but had no mechanism to remove it. Deleting
an InstanceHa CR would permanently orphan the Topology CR finalizer.
Add finalizer lifecycle following the DNSMasq controller pattern:
- Add finalizer on first reconcile (controllerutil.AddFinalizer)
- Check DeletionTimestamp before proceeding with reconciliation
- reconcileDelete removes the Topology CR finalizer via
EnsureDeletedTopologyRef, then removes the InstanceHa finalizer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9eab60f commit 320b90b
2 files changed
Lines changed: 38 additions & 0 deletions
File tree
- internal/controller/instanceha
- test/functional
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
179 | 184 | | |
180 | 185 | | |
181 | 186 | | |
| |||
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
190 | 200 | | |
191 | 201 | | |
192 | 202 | | |
| |||
897 | 907 | | |
898 | 908 | | |
899 | 909 | | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
900 | 931 | | |
901 | 932 | | |
902 | 933 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| |||
0 commit comments