diff --git a/lib/kamal/configuration.rb b/lib/kamal/configuration.rb index bd33b08c7..1d6dfd129 100644 --- a/lib/kamal/configuration.rb +++ b/lib/kamal/configuration.rb @@ -48,6 +48,8 @@ def initialize(raw_config, destination: nil, version: nil, validate: true) validate! raw_config, example: validation_yml.symbolize_keys, context: "", with: Kamal::Configuration::Validator::Configuration + @secrets = Kamal::Secrets.new(destination: destination) + # Eager load config to validate it, these are first as they have dependencies later on @servers = Servers.new(config: self) @registry = Registry.new(config: self) @@ -63,8 +65,6 @@ def initialize(raw_config, destination: nil, version: nil, validate: true) @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 @@ -259,10 +259,6 @@ def to_h }.compact end - def secrets - @secrets ||= Kamal::Secrets.new(destination: destination) - end - private # Will raise ArgumentError if any required config keys are missing def ensure_destination_if_required