Class: Philae::DockerProbe
- Inherits:
-
Object
- Object
- Philae::DockerProbe
- Defined in:
- lib/philae/docker_probe.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(name, endpoint = '/var/run/docker.sock', options = {}) ⇒ DockerProbe
constructor
A new instance of DockerProbe.
Constructor Details
#initialize(name, endpoint = '/var/run/docker.sock', options = {}) ⇒ DockerProbe
Returns a new instance of DockerProbe.
7 8 9 10 11 |
# File 'lib/philae/docker_probe.rb', line 7 def initialize(name, endpoint = '/var/run/docker.sock', = {}) @name = name @endpoint = endpoint @docker_options = {read_timeout: 50, connect_timeout: 50}.merge() end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/philae/docker_probe.rb', line 5 def name @name end |
Instance Method Details
#check ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/philae/docker_probe.rb', line 13 def check Docker.url = @endpoint Docker. = @docker_options begin Docker::Container.all rescue => e return { healthy: false, comment: "Unable to communicate with docker (#{e.})" } end return { healthy: true, comment: '' } end |