Merge pull request #1196 from tiramizoo/role-accessories-msg

Improve error on unknown role in accessories config.
This commit is contained in:
Donal McBreen
2024-11-21 15:02:48 +00:00
committed by GitHub

View File

@@ -176,7 +176,9 @@ class Kamal::Configuration::Accessory
def hosts_from_roles def hosts_from_roles
if accessory_config.key?("roles") if accessory_config.key?("roles")
accessory_config["roles"].flat_map { |role| config.role(role).hosts } accessory_config["roles"].flat_map do |role|
config.role(role)&.hosts || raise(Kamal::ConfigurationError, "Unknown role in accessories config: '#{role}'")
end
end end
end end