Check that there's no traefik hooks left behind

This commit is contained in:
Donal McBreen
2024-09-12 12:59:34 +01:00
parent ccb7424197
commit a40b644145
4 changed files with 27 additions and 2 deletions

View File

@@ -70,6 +70,7 @@ class Kamal::Configuration
ensure_valid_kamal_version
ensure_retain_containers_valid
ensure_valid_service_name
ensure_no_traefik_reboot_hooks
end
@@ -303,6 +304,16 @@ class Kamal::Configuration
true
end
def ensure_no_traefik_reboot_hooks
hooks = %w[ pre-traefik-reboot post-traefik-reboot ].select { |hook_file| File.exist?(File.join(hooks_path, hook_file)) }
if hooks.any?
raise Kamal::ConfigurationError, "Found #{hooks.join(", ")}, these should be renamed to (pre|post)-proxy-reboot"
end
true
end
def role_names
raw_config.servers.is_a?(Array) ? [ "web" ] : raw_config.servers.keys.sort

View File

@@ -2,7 +2,7 @@ class Kamal::Configuration::Validator::Proxy < Kamal::Configuration::Validator
def validate!
super
if config["host"].blank? && config["ssl"]
if config["hosts"].blank? && config["ssl"]
error "Must set a host to enable automatic SSL"
end
end