Merge pull request #762 from kryachkov/main

Trim long hostnames
This commit is contained in:
Donal McBreen
2024-05-10 16:05:27 +01:00
committed by GitHub
3 changed files with 30 additions and 1 deletions

View File

@@ -47,7 +47,8 @@ class Kamal::Cli::App::Boot
def start_new_version
audit "Booted app version #{version}"
execute *app.tie_cord(role.cord_host_file) if uses_cord?
execute *app.run(hostname: "#{host}-#{SecureRandom.hex(6)}")
hostname = "#{host.to_s[0...51].gsub(/\.+$/, '')}-#{SecureRandom.hex(6)}"
execute *app.run(hostname: hostname)
Kamal::Cli::Healthcheck::Poller.wait_for_healthy(pause_after_ready: true) { capture_with_info(*app.status(version: version)) }
end