kubernetes-health 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kubernetes/health/rack_on_migrate.rake +6 -3
- data/lib/kubernetes/health/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d5ce6594cbd093d1eeee80c2eb544f216b5e9e88cdf13f737af125b766c38f5
|
4
|
+
data.tar.gz: ea119848c807d5dadd80209d4209ac2676fe5cdee4d26198fc9b72522908bc61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 017507ff1b871284d22b9a5576fb2893fa11422fcc10d9d4219d121dc655a62c5b8427f549ec22ddc9b226c2d7d24558625190e4d721cfc133714d88cd7b9cdf
|
7
|
+
data.tar.gz: e1c50dae1f62c05f1ee79634b74c7a14648cfac4718b4e07b6c94708498a567feeb21321c045d34f8dd34085890b6a957dc2f2871dfb4e87bcdbcf95eecaa95d
|
@@ -5,15 +5,18 @@ namespace :kubernetes_health do
|
|
5
5
|
@counter=0
|
6
6
|
Rack::Handler.default.run ->(env) {
|
7
7
|
req = Rack::Request.new(env)
|
8
|
-
|
9
|
-
|
8
|
+
readiness = req.path_info == "#{Kubernetes::Health::Config.route_readiness}"
|
9
|
+
liveness = req.path_info == "#{Kubernetes::Health::Config.route_liveness}"
|
10
|
+
if readiness
|
10
11
|
@counter=@counter+1
|
11
12
|
http_codes = Kubernetes::Health::Config.rack_on_migrate_rotate_http_codes
|
12
13
|
http_code = http_codes[(@counter % http_codes.size)]
|
14
|
+
elsif liveness
|
15
|
+
http_code = 200
|
13
16
|
else
|
14
17
|
http_code = 404
|
15
18
|
end
|
16
|
-
Rails.logger.info "Kubernetes Health: Rack on Migrate - Path: #{req.path_info} / Params: #{req.params} /
|
19
|
+
Rails.logger.info "Kubernetes Health: Rack on Migrate - Path: #{req.path_info} / Params: #{req.params} / HTTP Code: #{http_code}"
|
17
20
|
[http_code, {}, []]
|
18
21
|
}
|
19
22
|
}
|