kubernetes-health 0.1.0 → 1.0.0

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
- SHA1:
3
- metadata.gz: 726bc092d8f0aecff2b1149af89a0da7dd463c2e
4
- data.tar.gz: 0f5170160a829c17eb1bcf49c3446eb9d3296283
2
+ SHA256:
3
+ metadata.gz: 54838ac8e10fa7854b717ea39a0e10ce1af9b951f7300b808e0398768a46d269
4
+ data.tar.gz: e4f410ed1f9bdab67fe37029f6e2bdacd173796e389dc520d4d97d46f03453e4
5
5
  SHA512:
6
- metadata.gz: f6bb961d18809c7fa1358a0ccb439e041a01c1f8c89ce389c301eb363d3aad16edeaac1126f2cba5ec090feb461c60b5ec0750ffadaa4b85bf407844434fc958
7
- data.tar.gz: 7ca5992a79ff325922299cff6a4de6abdf10d3441373d2e5faede3115363348dda5ce8622dee9b9b7a1c80ca4e50a586a91449edcfb7b1fb6da38f70ce676a1a
6
+ metadata.gz: 3c5a6e6f0c1fa828ba48e448c645870d04eb1ddf1e92e608ecd73cb3e3b06306bff9a3ca67dfe7ac64995328ef150890692e15ce18ebb6c05a736fd5d7c266c6
7
+ data.tar.gz: 92cc261f45e009c2334e6d2d43b8aa1d975d847b48070145d18e836e05e42a1380900560890a57dac6f2f8b953dd87472557891113284bf2b464e261745b1d81
data/README.md CHANGED
@@ -7,7 +7,7 @@ A simple gem that adds /_health in your APP.
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'kubernetes-health'
10
+ gem 'kubernetes-health', '~> 1.0'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -22,9 +22,12 @@ Or install it yourself as:
22
22
 
23
23
  Set Kubernetes::Health::Config.sick_if if you want to check other things.
24
24
 
25
- Ex. Check if PostgreSQL is working.
25
+ Ex. Check if PostgreSQL is working and wait for migrations.
26
26
  ```
27
- Kubernetes::Health::Config.sick_if = lambda { ActiveRecord::Base.connection.execute("SELECT 1").cmd_tuples != 1 }
27
+ Kubernetes::Health::Config.sick_if = lambda { |params|
28
+ return true if params[:wait_migration] == 'true' && File.exists?('migration.lock')
29
+ ActiveRecord::Base.connection.execute("SELECT 1").cmd_tuples != 1
30
+ }
28
31
  ```
29
32
 
30
33
  ## Custom route
@@ -1,11 +1,9 @@
1
1
  module Kubernetes
2
2
  class HealthController < ::ActionController::Base
3
3
  def status
4
- if Kubernetes::Health::Config.sick_if.call
5
- head 503
6
- else
7
- head 200
8
- end
4
+ i_am_sick = Kubernetes::Health::Config.sick_if.arity == 0 ? Kubernetes::Health::Config.sick_if.call : Kubernetes::Health::Config.sick_if.call(params)
5
+ return head 503 if i_am_sick
6
+ head 200
9
7
  end
10
8
  end
11
9
  end
@@ -1,5 +1,5 @@
1
1
  module Kubernetes
2
2
  module Health
3
- VERSION = "0.1.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-health
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wagner Caixeta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2019-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,10 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubyforge_project:
96
- rubygems_version: 2.6.8
95
+ rubygems_version: 3.0.1
97
96
  signing_key:
98
97
  specification_version: 4
99
98
  summary: A simple gem to add /_health to your Rails APP.
100
99
  test_files: []
101
- has_rdoc: