Make secrets global and init on first use.

This allows all containers to use any secret declared anywhere
in their placeholders but they will not be generated and
written to the configuration until they are used.

Signed-off-by: Alan Savage <3028205+asavageiv@users.noreply.github.com>
This commit is contained in:
Alan Savage 2025-09-09 14:44:23 -07:00
parent e4c2f44d81
commit 29c093afae
4 changed files with 15 additions and 27 deletions

View file

@ -239,9 +239,12 @@ readonly class ContainerDefinitionFetcher {
$internalPort = $entry['internal_port'];
}
$secrets = [];
if (isset($entry['secrets'])) {
$secrets = $entry['secrets'];
// All secrets are registered with the configuration when they
// are discovered so they can be later generated at time-of-use.
foreach ($entry['secrets'] as $secret) {
$this->configurationManager->RegisterSecret($secret);
}
}
$uiSecret = '';
@ -320,7 +323,6 @@ readonly class ContainerDefinitionFetcher {
$volumes,
$variables,
$dependsOn,
$secrets,
$uiSecret,
$devices,
$enableNvidiaGpu,