Commit b957def
Fix ReconcileVersion re-creating OpenStackVersion during deletion
When an OpenStackControlPlane CR is deleted, the reconciler called
ReconcileVersion() before checking DeletionTimestamp. ReconcileVersion
unconditionally called CreateOrPatch on the OpenStackVersion CR,
which would re-create it even during deletion.
This caused issues in adoption CI: the pcp_cleanup role deleted the
OpenStackControlPlane but the controller re-created the OpenStackVersion
before fully shutting down. The leftover OpenStackVersion (named
'controlplane' from the source cloud) then caused the new
OpenStackControlPlane (named 'openstack') to be rejected by the
webhook with:
OpenStackControlPlane 'openstack' must have same name as the
existing 'controlplane' OpenStackVersion
Fix ReconcileVersion to properly handle the Get result:
- Return actual errors (not IsNotFound) instead of swallowing them
- Skip CreateOrPatch when the controlplane is being deleted
- Still return the existing version object so reconcileDelete can
remove its finalizer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Martin Schuppert <mschuppert@redhat.com>1 parent 55df25d commit b957def
3 files changed
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
247 | | - | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
255 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
256 | 263 | | |
257 | 264 | | |
258 | 265 | | |
| |||
0 commit comments