mirror of
https://github.com/cozystack/cozystack.git
synced 2026-10-28 23:57:08 +09:00
The VMI webhook resolves a VMI's claim references, refuses what needs no placement to judge, records the attachment of each held claim and writes one gpus entry per unit with the class's resource name. It binds, moves and creates nothing: budgets, capacity and template claims are the controller's, so a VM whose set does not fit yet waits at start instead of being refused into KubeVirt's backoff. The pod webhook holds the launcher pod, and the temporary pod for WaitForFirstConsumer volumes, at the claims' scheduling gate and adds the tolerations of the claims' classes, which binding already counted on. A repeated call adds neither twice, since a duplicate gate fails pod validation. Migration targets are left alone, because KubeVirt deletes a target pod that stays pending. The order webhook refuses a tenant's GPUClaim that cannot be met now: class, maxCount, published free units, budgets and the vGPU entitlement. Template claims skip it; the tamper policy keeps their mark out of tenants' hands. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>