From ccf32c2c1f6068058a51a84fd8aa93dfc4b720bf Mon Sep 17 00:00:00 2001 From: junket Date: Thu, 3 Oct 2024 09:31:30 -0400 Subject: [PATCH 1/2] Pass false values in env vars to docker --- lib/kamal/utils.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/kamal/utils.rb b/lib/kamal/utils.rb index ab8dd50e7..58daaa91d 100644 --- a/lib/kamal/utils.rb +++ b/lib/kamal/utils.rb @@ -12,6 +12,8 @@ def argumentize(argument, attributes, sensitive: false) attr = "#{key}=#{escape_shell_value(value)}" attr = self.sensitive(attr, redaction: "#{key}=[REDACTED]") if sensitive [ argument, attr ] + elsif value == false + [ argument, "#{key}=false" ] else [ argument, key ] end From 6d1d7a4c82be128beeff825834a849fa900b0b76 Mon Sep 17 00:00:00 2001 From: junket <789854+junket@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:05:54 -0400 Subject: [PATCH 2/2] Updates argumentize test for false values --- test/utils_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils_test.rb b/test/utils_test.rb index e292e9801..a8fa07977 100644 --- a/test/utils_test.rb +++ b/test/utils_test.rb @@ -2,8 +2,8 @@ class UtilsTest < ActiveSupport::TestCase test "argumentize" do - assert_equal [ "--label", "foo=\"\\`bar\\`\"", "--label", "baz=\"qux\"", "--label", :quux ], \ - Kamal::Utils.argumentize("--label", { foo: "`bar`", baz: "qux", quux: nil }) + assert_equal [ "--label", "foo=\"\\`bar\\`\"", "--label", "baz=\"qux\"", "--label", :quux, "--label", "quuz=false" ], \ + Kamal::Utils.argumentize("--label", { foo: "`bar`", baz: "qux", quux: nil, quuz: false }) end test "argumentize with redacted" do