Allow capital letters to match valid service name, such as in MyApp
This commit is contained in:
@@ -301,7 +301,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, hyphens, and underscores" 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_-]+$/i
|
||||||
|
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class ConfigurationTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
test "service name valid" do
|
test "service name valid" do
|
||||||
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "hey-app1_primary" }).valid?
|
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "hey-app1_primary" }).valid?
|
||||||
|
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "MyApp" }).valid?
|
||||||
end
|
end
|
||||||
|
|
||||||
test "service name invalid" do
|
test "service name invalid" do
|
||||||
|
|||||||
Reference in New Issue
Block a user