Files
cozystack/pkg
Mattia Eleuteri e67a514903 fix(lineage-webhook): keep the tenant class when an application's is refused
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>
2026-11-23 08:05:08 +01:00
..