Add a mutex around loading secrets

Loading secrets may ask for use input, so we need to ensure only one
thread does it at a time.
This commit is contained in:
Donal McBreen
2024-09-16 14:44:39 +01:00
parent 876eebc7c5
commit 6bbbd81da1
2 changed files with 8 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ class Kamal::Configuration
delegate :service, :image, :labels, :stop_wait_time, :hooks_path, to: :raw_config, allow_nil: true
delegate :argumentize, :optionize, to: Kamal::Utils
attr_reader :destination, :raw_config
attr_reader :destination, :raw_config, :secrets
attr_reader :accessories, :aliases, :boot, :builder, :env, :healthcheck, :logging, :traefik, :servers, :ssh, :sshkit, :registry
include Validation
@@ -64,6 +64,8 @@ class Kamal::Configuration
@ssh = Ssh.new(config: self)
@sshkit = Sshkit.new(config: self)
@secrets = Kamal::Secrets.new(destination: destination)
ensure_destination_if_required
ensure_required_keys_present
ensure_valid_kamal_version