Merge pull request #1396 from basecamp/allow-accessory-roles-with-no-hosts

Allow accessory roles with no hosts
This commit is contained in:
Donal McBreen
2025-02-03 16:54:28 +00:00
committed by GitHub

View File

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