k8s_kit 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/k8s_kit.gemspec +1 -0
- data/lib/k8s_kit/job.rb +9 -0
- data/lib/k8s_kit/pod.rb +1 -1
- data/lib/k8s_kit/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 199d7b5fa00b608549b485ba60121a8bfe8f6a3934f11abb7c8fa6354ccca95f
|
4
|
+
data.tar.gz: 02e5681d3e64df7b8092a85f0ad995b1c5e382bc61eb4828ced0bca90db19c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9609c38d8b3f6f11bf7b72d6c4638e8d80e923dad3bfa6a8956aa75cc7d7a45d7ad77714eb7e91e7a639d0294fe23ef5f6e2b1c5e44ef2b047c7cf1984f7a64c
|
7
|
+
data.tar.gz: a16c175304176e2f20d405c10d0bf288a5583f1795faeca81bf4db2ce1dcd8a4cef0fe6e3206b1ca39675f22b2662daa26c5601f1eea3eb9151d2c5fab91e732
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
k8s_kit (0.0.
|
4
|
+
k8s_kit (0.0.6)
|
5
5
|
gli (= 2.18.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -49,6 +49,7 @@ GEM
|
|
49
49
|
rspec-support (~> 3.8.0)
|
50
50
|
rspec-support (3.8.2)
|
51
51
|
thor (0.20.3)
|
52
|
+
waitutil (0.2.1)
|
52
53
|
|
53
54
|
PLATFORMS
|
54
55
|
ruby
|
@@ -59,6 +60,7 @@ DEPENDENCIES
|
|
59
60
|
k8s_kit!
|
60
61
|
rake
|
61
62
|
rdoc
|
63
|
+
waitutil
|
62
64
|
|
63
65
|
BUNDLED WITH
|
64
66
|
2.0.2
|
data/k8s_kit.gemspec
CHANGED
data/lib/k8s_kit/job.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'waitutil'
|
2
|
+
|
1
3
|
module K8sKit
|
2
4
|
class Job
|
3
5
|
attr_reader :context, :name
|
@@ -10,6 +12,13 @@ module K8sKit
|
|
10
12
|
def attach(container:, delete_on_completion: true, exit_on_completion: true)
|
11
13
|
pod.wait_until_ready
|
12
14
|
pod.logs(container: container, stream: true)
|
15
|
+
|
16
|
+
WaitUtil.wait_for_condition("pod has exit code",
|
17
|
+
:timeout_sec => 30,
|
18
|
+
:delay_sec => 0.5) do
|
19
|
+
pod.exit_code(container: container) != nil
|
20
|
+
end
|
21
|
+
|
13
22
|
exit_code = pod.exit_code(container: container)
|
14
23
|
|
15
24
|
delete if delete_on_completion
|
data/lib/k8s_kit/pod.rb
CHANGED
@@ -21,7 +21,7 @@ module K8sKit
|
|
21
21
|
|
22
22
|
def exit_code(container:)
|
23
23
|
json_path = "{ .status.containerStatuses[?(@.name == '#{container}')].state.terminated.exitCode }"
|
24
|
-
context.run("get pod #{name} -o jsonpath=\"#{json_path}\"")
|
24
|
+
Integer(context.run("get pod #{name} -o jsonpath=\"#{json_path}\""))
|
25
25
|
rescue StandardError
|
26
26
|
nil
|
27
27
|
end
|
data/lib/k8s_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k8s_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Your Name Here
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.18.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: waitutil
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
description:
|
84
98
|
email: your@email.address.com
|
85
99
|
executables:
|
@@ -121,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
135
|
- !ruby/object:Gem::Version
|
122
136
|
version: '0'
|
123
137
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.1.2
|
125
139
|
signing_key:
|
126
140
|
specification_version: 4
|
127
141
|
summary: A description of your project
|