Commit 0008d82
committed
fix: detachHTTPRoutes uses Spec.ParentRefs not Status.Parents
Status.Parents is written by Envoy Gateway and can be stale or empty
at finalization time. Spec.ParentRefs is written by NSO and is always
authoritative.
The old code checked Status.Parents to determine which HTTPRoutes
referenced a gateway being finalized, then mutated Status.Parents
via a status subresource update. This was wrong: if EG hadn't yet
reconciled the route (e.g. during rapid gateway deletion or Karmada
status aggregation lag), Status.Parents would be empty and the route
would appear to have no parents, causing it to be deleted or left
with stale status. In the converse case, EG could leave a stale
Status.Parents entry after the spec parentRef was already removed,
preventing cleanup.
Now detachHTTPRoutes iterates Spec.ParentRefs, builds the remaining
refs excluding the gateway being finalized, and either deletes the
route (no remaining refs + deleteWhenNoParents) or updates Spec to
remove the dead parentRef. EG will reconcile Status.Parents from the
updated spec naturally.
Fixes #2311 parent cc2c309 commit 0008d82
1 file changed
Lines changed: 18 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
1605 | 1605 | | |
1606 | 1606 | | |
1607 | | - | |
| 1607 | + | |
1608 | 1608 | | |
1609 | 1609 | | |
1610 | | - | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1611 | 1615 | | |
1612 | 1616 | | |
1613 | 1617 | | |
1614 | 1618 | | |
1615 | 1619 | | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
1619 | 1626 | | |
1620 | 1627 | | |
1621 | 1628 | | |
| |||
0 commit comments