Enable safe NPM replica convergence

This commit is contained in:
Lyncoln
2026-09-20 10:37:11 -04:00
parent 291f4f492e
commit e4ca80d4d5
7 changed files with 351 additions and 16 deletions
+17
View File
@@ -314,6 +314,17 @@ def _required_capability(
)
def _required_retirement_support(
adapter: ExecutionAdapter,
) -> None:
retire = getattr(adapter, "retire", None)
if not callable(retire):
raise RuntimeError(
f"{adapter.endpoint.identity} adapter does not support "
"deferred retirement"
)
def _preflight(
adapters: Iterable[ExecutionAdapter],
plans: Iterable[EndpointPlan],
@@ -345,6 +356,9 @@ def _preflight(
f"No adapter for endpoint plan {plan.endpoint_id}"
)
if plan.retirements:
_required_retirement_support(adapter)
for retirement in plan.retirements:
planned_retirements.append(
(
@@ -381,6 +395,9 @@ def _preflight(
"Executable plan action requires desired state"
)
if action.operation == PlanOperation.REPLACE:
_required_retirement_support(adapter)
object_type = action.desired.object_type
_required_capability(
adapter,