marathon-srv 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/marathon/srv/client.rb +11 -8
- data/lib/marathon/srv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5da8830afef77b37faf38ed0611aba764248694f
|
4
|
+
data.tar.gz: 678712c4dcb2d73f0755f80d78f9b2e0f9b33bfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ea6c0f58114533ef79c0ffe6db5b62dcb0f2113598a8db8a8ea75b5eab2df5c5b6381686e1efc7d85993b82b7945804ef388608196dc499c1f353c38542cbea
|
7
|
+
data.tar.gz: 85ceb208e763b931403b853de69ba2d459a0da37faed12776f9a191f5cb5434b0907572a51ebaa13e9637d7bef064274057009205d8d7921ebe01d188f74a88c
|
data/lib/marathon/srv/client.rb
CHANGED
@@ -62,7 +62,7 @@ module Marathon
|
|
62
62
|
|
63
63
|
raise Marathon::Srv::NotDockerContainerizedApplicationError.new unless app["container"]["type"] == "DOCKER"
|
64
64
|
raise Marathon::Srv::NoRunningTasksFoundError.new unless app["tasks"].size > 0
|
65
|
-
raise Marathon::Srv::NoHealthChecksDefinedError.new unless app["healthChecks"] != nil && app["healthChecks"].size > 0
|
65
|
+
raise Marathon::Srv::NoHealthChecksDefinedError.new unless healthy_tasks_only == false || (app["healthChecks"] != nil && app["healthChecks"].size > 0)
|
66
66
|
|
67
67
|
# collect slave ports of (healthy) tasks
|
68
68
|
ports=[]
|
@@ -71,14 +71,17 @@ module Marathon
|
|
71
71
|
|
72
72
|
if(healthy_tasks_only)
|
73
73
|
@logger.debug "Verifying health checks for task #{task}"
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
if (task["healthCheckResults"] != nil)
|
75
|
+
# all health checks must be passing
|
76
|
+
passing=true
|
77
|
+
task["healthCheckResults"].each do |health_check_result|
|
78
|
+
(passing=false; @logger.debug "%s has failing health check, not considering it" % task; break) unless health_check_result["alive"] == true
|
79
|
+
|
80
|
+
end
|
81
|
+
(@logger.debug "All health checks passing - filtering ports for task #{task}"; ports.push filter_ports(app, task, filter_ports)) if passing
|
82
|
+
else
|
83
|
+
@logger.debug "No health check results - ignoring task #{task}"
|
79
84
|
end
|
80
|
-
(@logger.debug "All health checks passing - filtering ports for task #{task}"; ports.push filter_ports(app, task, filter_ports)) if passing
|
81
|
-
|
82
85
|
else
|
83
86
|
# just add task
|
84
87
|
@logger.debug "Ignoring health checks - filtering ports for task #{task}"
|
data/lib/marathon/srv/version.rb
CHANGED