Add hyphen to the allowed character list for service name
This commit is contained in:
@@ -284,7 +284,7 @@ class Kamal::Configuration
|
|||||||
end
|
end
|
||||||
|
|
||||||
def ensure_valid_service_name
|
def ensure_valid_service_name
|
||||||
raise ArgumentError, "Service name can only include alphanumeric characters and hyphens" unless raw_config[:service] =~ /^[a-z0-9-]+$/
|
raise ArgumentError, "Service name can only include alphanumeric characters, hyphens, and underscores" unless raw_config[:service] =~ /^[a-z0-9-_]+$/
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class ConfigurationTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "service name valid" do
|
test "service name valid" do
|
||||||
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "hey-app1" }).valid?
|
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "hey-app1_primary" }).valid?
|
||||||
end
|
end
|
||||||
|
|
||||||
test "service name invalid" do
|
test "service name invalid" do
|
||||||
|
|||||||
Reference in New Issue
Block a user