Interrupting parent on error
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
class Kamal::Secrets::Adapters::Base
|
||||
delegate :optionize, to: Kamal::Utils
|
||||
|
||||
def fetch(secrets, account:, location: nil)
|
||||
def fetch(secrets, account:, from: nil)
|
||||
session = login(account)
|
||||
full_secrets = secrets.map { |secret| [ location, secret ].compact.join("/") }
|
||||
full_secrets = secrets.map { |secret| [ from, secret ].compact.join("/") }
|
||||
fetch_from_vault(full_secrets, account: account, session: session)
|
||||
rescue => e
|
||||
$stderr.puts " \e[31mERROR (#{e.class}): #{e.message}\e[0m"
|
||||
$stderr.puts e.backtrace if ENV["VERBOSE"]
|
||||
|
||||
Process.kill("INT", Process.ppid) if ENV["KAMAL_SECRETS_KILL_PARENT"]
|
||||
Process.kill("INT", Process.ppid) if ENV["KAMAL_SECRETS_INT_PARENT"]
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user