From 31a347c285f6f362dae673111152972cc4306260 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Wed, 4 Sep 2024 12:52:30 +0100 Subject: [PATCH] Move int parent comment --- lib/kamal/secrets.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/kamal/secrets.rb b/lib/kamal/secrets.rb index 5c15bc9b..151dd3b2 100644 --- a/lib/kamal/secrets.rb +++ b/lib/kamal/secrets.rb @@ -6,10 +6,7 @@ class Kamal::Secrets end def [](key) - # If dot env interpolates any `kamal secrets` calls, this tells it to interrupt this process if there are errors - ENV["KAMAL_SECRETS_INT_PARENT"] = "1" - - @secrets ||= secrets_file ? Dotenv.parse(secrets_file) : {} + @secrets ||= parse_secrets @secrets.fetch(key) rescue KeyError if secrets_file @@ -29,6 +26,7 @@ class Kamal::Secrets end def interrupting_parent_on_error + # Make any `kamal secrets` calls in dotenv interpolation interrupt this process if there are errors ENV["KAMAL_SECRETS_INT_PARENT"] = "1" yield ensure