Class: Kamal::Cli::Doctor::HostChecks
- Inherits:
-
Object
- Object
- Kamal::Cli::Doctor::HostChecks
- Defined in:
- lib/kamal/cli/doctor/host_checks.rb
Overview
Remote readiness checks for a single host, run inside an SSHKit backend.
Every check rescues StandardError at its boundary: the doctor's contract is to report broken environments, not crash on them, and a failed connection can raise anything from Net::SSH errors to Errno and DNS resolution errors.
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#proxy_host ⇒ Object
readonly
Returns the value of attribute proxy_host.
-
#sshkit ⇒ Object
readonly
Returns the value of attribute sshkit.
Instance Method Summary collapse
-
#initialize(host, sshkit, proxy_host:) ⇒ HostChecks
constructor
A new instance of HostChecks.
- #run ⇒ Object
Constructor Details
#initialize(host, sshkit, proxy_host:) ⇒ HostChecks
Returns a new instance of HostChecks.
10 11 12 13 14 |
# File 'lib/kamal/cli/doctor/host_checks.rb', line 10 def initialize(host, sshkit, proxy_host:) @host = host @sshkit = sshkit @proxy_host = proxy_host end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
7 8 9 |
# File 'lib/kamal/cli/doctor/host_checks.rb', line 7 def host @host end |
#proxy_host ⇒ Object (readonly)
Returns the value of attribute proxy_host.
7 8 9 |
# File 'lib/kamal/cli/doctor/host_checks.rb', line 7 def proxy_host @proxy_host end |
#sshkit ⇒ Object (readonly)
Returns the value of attribute sshkit.
7 8 9 |
# File 'lib/kamal/cli/doctor/host_checks.rb', line 7 def sshkit @sshkit end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/kamal/cli/doctor/host_checks.rb', line 16 def run checks = { ssh: ssh_check } if checks[:ssh].ok? checks[:docker] = docker_check checks[:registry] = registry_check checks.merge!(proxy_checks) if proxy_host end checks end |