vars: introduce ensure_machine_has_access method for sops

this should help avoiding overriding existing shared secrets by not
triggering vars regeneration if a machine has no access.

wip
This commit is contained in:
Jörg Thalheim
2024-11-14 13:17:50 +01:00
committed by kenji
parent b3b72e54cd
commit 9c6e04fa3f

View File

@@ -297,6 +297,10 @@ def _check_can_migrate(
if machine.secret_vars_store.exists(
generator_name, fname, vars_generator["share"]
):
if vars_generator["deploy"]:
machine.secret_vars_store.ensure_machine_has_access(
generator_name, fname, vars_generator["share"]
)
return False
else:
if machine.public_vars_store.exists(