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 +5 -5
- data/README.md +6 -3
- data/app/controllers/kubernetes/health_controller.rb +3 -5
- data/lib/kubernetes/health/version.rb +1 -1
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 54838ac8e10fa7854b717ea39a0e10ce1af9b951f7300b808e0398768a46d269
|
4
|
+
data.tar.gz: e4f410ed1f9bdab67fe37029f6e2bdacd173796e389dc520d4d97d46f03453e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 {
|
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
|
-
|
5
|
-
|
6
|
-
|
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
|
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:
|
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:
|
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
|
-
|
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:
|