Merge branch 'basecamp:main' into buildpacks
This commit is contained in:
@@ -187,4 +187,12 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
|
||||
assert @config.accessory(:monitoring).running_proxy?
|
||||
assert_equal [ "monitoring.example.com" ], @config.accessory(:monitoring).proxy.hosts
|
||||
end
|
||||
|
||||
test "can't set restart in options" do
|
||||
@deploy[:accessories]["mysql"]["options"] = { "restart" => "always" }
|
||||
|
||||
assert_raises Kamal::ConfigurationError, "servers/workers: Cannot set restart policy in docker options, unless-stopped is required" do
|
||||
Kamal::Configuration.new(@deploy)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,6 +38,13 @@ class ConfigurationProxyTest < ActiveSupport::TestCase
|
||||
assert_not config.proxy.ssl?
|
||||
end
|
||||
|
||||
test "false not allowed" do
|
||||
@deploy[:proxy] = false
|
||||
assert_raises(Kamal::ConfigurationError, "proxy: should be a hash") do
|
||||
config.proxy
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def config
|
||||
Kamal::Configuration.new(@deploy)
|
||||
|
||||
@@ -258,6 +258,14 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
|
||||
assert_equal "18s", config_with_roles.role(:workers).proxy.deploy_options[:"target-timeout"]
|
||||
end
|
||||
|
||||
test "can't set restart in options" do
|
||||
@deploy_with_roles[:servers]["workers"]["options"] = { "restart" => "always" }
|
||||
|
||||
assert_raises Kamal::ConfigurationError, "servers/workers: Cannot set restart policy in docker options, unless-stopped is required" do
|
||||
Kamal::Configuration.new(@deploy_with_roles)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def config
|
||||
Kamal::Configuration.new(@deploy)
|
||||
|
||||
Reference in New Issue
Block a user