HomeClusterLabs Projects

Refactor: scheduler: split can_run_instance() into two functions

Description

Refactor: scheduler: split can_run_instance() into two functions

can_run_instance() had two completely separate modes of behavior: the original
caller would pass a NULL node which would iterate over all allowed nodes using
recursive calls with a non-NULL node.

There's no need for recursion, just separate it into two functions. It also
makes the naming make more sense, since the function previously returned void
and updated allowed node scores. Now, can_run_instance() is a bool check as
would be expected, and the new ban_unavailable_allowed_nodes() updates the
scores.

Details

Provenance
kgaillotAuthored on Jun 30 2022, 5:17 PM
Parents
rP2db829258cac: Refactor: scheduler: move shared clone/bundle code from pcmk_sched_clone.c
Branches
Unknown
Tags
Unknown