Merge pull request #770 from ttilberg/769-ensure-valid-service-name-with-capital-letters

Allow capital letters to match valid service name, such as in MyApp
This commit is contained in:
Donal McBreen
2024-04-25 11:52:55 +01:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -301,7 +301,7 @@ class Kamal::Configuration
end
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
end

View File

@@ -44,6 +44,7 @@ class ConfigurationTest < ActiveSupport::TestCase
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] = "MyApp" }).valid?
end
test "service name invalid" do