Ensure we don't load the secrets more than once
Secrets were being created twice, which might require logging in twice.
This commit is contained in:
@@ -48,6 +48,8 @@ class Kamal::Configuration
|
|||||||
|
|
||||||
validate! raw_config, example: validation_yml.symbolize_keys, context: "", with: Kamal::Configuration::Validator::Configuration
|
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
|
# Eager load config to validate it, these are first as they have dependencies later on
|
||||||
@servers = Servers.new(config: self)
|
@servers = Servers.new(config: self)
|
||||||
@registry = Registry.new(config: self)
|
@registry = Registry.new(config: self)
|
||||||
@@ -63,8 +65,6 @@ class Kamal::Configuration
|
|||||||
@ssh = Ssh.new(config: self)
|
@ssh = Ssh.new(config: self)
|
||||||
@sshkit = Sshkit.new(config: self)
|
@sshkit = Sshkit.new(config: self)
|
||||||
|
|
||||||
@secrets = Kamal::Secrets.new(destination: destination)
|
|
||||||
|
|
||||||
ensure_destination_if_required
|
ensure_destination_if_required
|
||||||
ensure_required_keys_present
|
ensure_required_keys_present
|
||||||
ensure_valid_kamal_version
|
ensure_valid_kamal_version
|
||||||
@@ -259,10 +259,6 @@ class Kamal::Configuration
|
|||||||
}.compact
|
}.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
def secrets
|
|
||||||
@secrets ||= Kamal::Secrets.new(destination: destination)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
# Will raise ArgumentError if any required config keys are missing
|
# Will raise ArgumentError if any required config keys are missing
|
||||||
def ensure_destination_if_required
|
def ensure_destination_if_required
|
||||||
|
|||||||
Reference in New Issue
Block a user