vars: refactor - make shared generators carry machines list

This should make it simpler to improve the implementation of granting a new machine access to a shared secret.
The current approach using the health_check is  pretty hacky
This commit is contained in:
DavHau
2025-10-09 15:40:51 +07:00
parent f194c31e0e
commit fd5d7934a0
5 changed files with 78 additions and 52 deletions

View File

@@ -181,10 +181,10 @@ def run_generators(
flake = machines[0].flake
def get_generator_machine(generator: Generator) -> Machine:
if generator.machine is None:
# return first machine if generator is not tied to a specific one
if generator.share:
# return first machine if generator is shared
return machines[0]
return Machine(name=generator.machine, flake=flake)
return Machine(name=generator.machines[0], flake=flake)
# preheat the select cache, to reduce repeated calls during execution
selectors = []