Commit f528283
committed
Do not report host deletion as completed on an unknown API error
deleteHost() fetches the host StatefulSet and treats any error from that
Get as "StatefulSet not found - already deleted", emitting a
DeleteCompleted event and returning nil. Only NotFound actually means the
host is gone; a Forbidden, a timeout or any other transient API error
takes the same branch.
That early return skips both deleteTables() - which the surrounding
comment notes is required so ZooKeeper stops tracking the host's tables -
and Controller.deleteHost(), which deletes the host's PVCs. Those PVCs
carry no owner reference (see model/common/creator/pvc.go, where it is
commented out to stay compatible with the PV retain policy), so the
operator's own call is the only thing that ever reclaims them.
Classify the error instead: keep the existing behaviour for NotFound, and
on any other error emit DeleteFailed and return it rather than claiming
the host was deleted. apiErrors.IsNotFound is already used this way
elsewhere in the package, for example in worker-pdb.go.
Signed-off-by: Somanchi Poorna Sobhita <somanchi004@gmail.com>1 parent 1a3fc27 commit f528283
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
539 | 540 | | |
540 | 541 | | |
541 | 542 | | |
542 | | - | |
543 | | - | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
544 | 558 | | |
545 | | - | |
| 559 | + | |
546 | 560 | | |
547 | | - | |
| 561 | + | |
548 | 562 | | |
549 | 563 | | |
550 | 564 | | |
| |||
0 commit comments