Skip to content

Commit

Permalink
Merge pull request #1045 from junket/allow-false-env-var-value
Browse files Browse the repository at this point in the history
Allow false env var value
  • Loading branch information
djmb authored Oct 23, 2024
2 parents a3e5505 + 6d1d7a4 commit 66f6e8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/kamal/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66f6e8b

Please sign in to comment.