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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 809331bcf24f88f951d92290782878d1e52ae93f789bdeddafe9096fff731402
4
- data.tar.gz: 83ca0cbff7856d12eb1fe5ac217cafb8d6c578c9cc891bc626f3645649d92eb5
3
+ metadata.gz: 9d5ce6594cbd093d1eeee80c2eb544f216b5e9e88cdf13f737af125b766c38f5
4
+ data.tar.gz: ea119848c807d5dadd80209d4209ac2676fe5cdee4d26198fc9b72522908bc61
5
5
  SHA512:
6
- metadata.gz: 6007ce776ce879c62b57756eaa5e179fb581f9549aa9e323cd252b4f422f6cfb72a67280691028b785d3a609e9a3c7d330bf2b6b86e539ec49b50ce0cb6e1511
7
- data.tar.gz: dd4a6316ddbd1272b1cff7b2c79b0dab83125dfe4a4b1cae644e4dcd379a5e43498e4f3667d5ebe339c971e74b594afecf734caf1d1c5f9245d8ddcc3e900f2a
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
- valid = req.path_info == "#{Kubernetes::Health::Config.route_readiness}"
9
- if valid
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} / Count: #{@counter} / HTTP Code: #{http_code}"
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
  }
@@ -1,5 +1,5 @@
1
1
  module Kubernetes
2
2
  module Health
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-health
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wagner Caixeta