Configuration::Secrets -> Secrets
This commit is contained in:
committed by
Donal McBreen
parent
7daaabd4d4
commit
3f37fea7c3
@@ -254,7 +254,7 @@ class Kamal::Configuration
|
|||||||
end
|
end
|
||||||
|
|
||||||
def secrets
|
def secrets
|
||||||
@secrets ||= Secrets.new(destination: destination)
|
@secrets ||= Kamal::Secrets.new(destination: destination)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class Kamal::Configuration::Secrets
|
class Kamal::Secrets
|
||||||
attr_reader :secrets_file
|
attr_reader :secrets_file
|
||||||
|
|
||||||
def initialize(destination: nil)
|
def initialize(destination: nil)
|
||||||
0
test/cli/secrets_test.rb
Normal file
0
test/cli/secrets_test.rb
Normal file
@@ -28,7 +28,7 @@ class ConfigurationEnvTest < ActiveSupport::TestCase
|
|||||||
"secret" => [ "PASSWORD" ]
|
"secret" => [ "PASSWORD" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
assert_raises(Kamal::ConfigurationError) { Kamal::Configuration::Env.new(config: { "secret" => [ "PASSWORD" ] }, secrets: Kamal::Configuration::Secrets.new).args }
|
assert_raises(Kamal::ConfigurationError) { Kamal::Configuration::Env.new(config: { "secret" => [ "PASSWORD" ] }, secrets: Kamal::Secrets.new).args }
|
||||||
end
|
end
|
||||||
|
|
||||||
test "secret and clear" do
|
test "secret and clear" do
|
||||||
@@ -49,7 +49,7 @@ class ConfigurationEnvTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
private
|
private
|
||||||
def assert_config(config:, results:)
|
def assert_config(config:, results:)
|
||||||
env = Kamal::Configuration::Env.new config: config, secrets: Kamal::Configuration::Secrets.new
|
env = Kamal::Configuration::Env.new config: config, secrets: Kamal::Secrets.new
|
||||||
expected_args = results.to_a.flat_map { |key, value| [ "--env", "#{key}=\"#{value}\"" ] }
|
expected_args = results.to_a.flat_map { |key, value| [ "--env", "#{key}=\"#{value}\"" ] }
|
||||||
assert_equal expected_args, env.args.map(&:to_s) # to_s removes the redactions
|
assert_equal expected_args, env.args.map(&:to_s) # to_s removes the redactions
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user