mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
The webhook fell back to the tenant class only when an application left spec.schedulingClass empty. A value naming a class that does not exist, or one the tenant does not allow, left the pod with no scheduler at all, so a typo, or a deliberate bogus name, in any application lifted the placement constraint the tenant administrator had set. Admission sees the application only once, so a class removed from the allowed list afterwards has to be caught here as well. Naming the tenant's own class needs no entry in the list, being the same as leaving the field empty. The application class is looked up once, so a class deleted between deciding and injecting cannot leave the pod with neither class. A lookup error fails the admission instead of counting as absence: otherwise a timeout or a 5xx from the apiserver would admit the Pod on the default scheduler, outside the tenant's constraint, until it was recreated. Under failurePolicy Fail its controller retries. Only an absent class, or an absent SchedulingClass CRD, means there is nothing to inject. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io>