marathon-srv 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 593a5842b3b6e8a4ad064d43e1ce33cd0e191942
4
- data.tar.gz: 13962e41a441a18964aedff0a307fa01ef75a357
3
+ metadata.gz: 5da8830afef77b37faf38ed0611aba764248694f
4
+ data.tar.gz: 678712c4dcb2d73f0755f80d78f9b2e0f9b33bfc
5
5
  SHA512:
6
- metadata.gz: a2db9b8d080f9b3d1eee126a17b89049c15fbeda0238034d78c43758c8015ee1364f0ba0fc564b72c8e9f34d85fb3276bae13bc161f02088b20cae354f36d9c5
7
- data.tar.gz: d13dc1b605c105c28dfb95a20b4913a2877ab5bef70758f9965d5dd3a775734f3c02b7131954509866cd3c8af07dd35876d98785b22ffab3cf2a0e78db61d008
6
+ metadata.gz: 5ea6c0f58114533ef79c0ffe6db5b62dcb0f2113598a8db8a8ea75b5eab2df5c5b6381686e1efc7d85993b82b7945804ef388608196dc499c1f353c38542cbea
7
+ data.tar.gz: 85ceb208e763b931403b853de69ba2d459a0da37faed12776f9a191f5cb5434b0907572a51ebaa13e9637d7bef064274057009205d8d7921ebe01d188f74a88c
@@ -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
- # all health checks must be passing
75
- passing=true
76
- task["healthCheckResults"].each do |health_check_result|
77
- (passing=false; @logger.debug "%s has failing health check, not considering it" % task; break) unless health_check_result["alive"] == true
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}"
@@ -1,5 +1,5 @@
1
1
  module Marathon
2
2
  module Srv
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marathon-srv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andras Szerdahelyi