The cleaner way to get this use case implemented is to take advantage of the sharing model as explained in our documentation regarding Shared Agents. In the documentation you will see that one efficient way to achieve the goal is to define a folder structure at Operations Center level that groups controllers with the shared agent or shared cloud that you want it to be able to use.
The sharing model used for shared agents is the same as the credentials propagation and role-based access control plugin’s group inheritance model.
The following logic is used to locate a shared agent:
If there is an available shared agent (or shared cloud) at the current level and that agent has the labels required by the job, then that agent is leased.
If there is no matching shared agent (or shared cloud with available capacity) at the current level, then proceed to the parent level and repeat.
Other options might include defining the pod template for the agent (in case that you are using kubernetes agents) inside the selected Controllers, but the cleaner way to achieve the goal is the one shown above.