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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb87fd17107c00f95fe9b03e7dec41750c872c6d0877b3a31f0703d2a51daad2
4
- data.tar.gz: c460411ec083b992e1848f8a5d6881683b5c40b9dd97de108f20310574225e6a
3
+ metadata.gz: 199d7b5fa00b608549b485ba60121a8bfe8f6a3934f11abb7c8fa6354ccca95f
4
+ data.tar.gz: 02e5681d3e64df7b8092a85f0ad995b1c5e382bc61eb4828ced0bca90db19c1f
5
5
  SHA512:
6
- metadata.gz: 587ba981131ec0f1a622a9ce9c1a6bfef8d6c1f02972f06d7c7b6845471446db8f99759cb8ac7db5e3dc8b9cf123469a2238746db1bfae325ddf54e64dcfe816
7
- data.tar.gz: ba83f871839a8d56890b55885ab04c082fb88ae806fb1d9016415322a963d4d28d8a4310d8fc2d4320286c5d0a303809501a90561e39e0171910d41f02724871
6
+ metadata.gz: 9609c38d8b3f6f11bf7b72d6c4638e8d80e923dad3bfa6a8956aa75cc7d7a45d7ad77714eb7e91e7a639d0294fe23ef5f6e2b1c5e44ef2b047c7cf1984f7a64c
7
+ data.tar.gz: a16c175304176e2f20d405c10d0bf288a5583f1795faeca81bf4db2ce1dcd8a4cef0fe6e3206b1ca39675f22b2662daa26c5601f1eea3eb9151d2c5fab91e732
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- k8s_kit (0.0.3)
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
@@ -19,4 +19,5 @@ spec = Gem::Specification.new do |s|
19
19
  s.add_development_dependency('rdoc')
20
20
  s.add_development_dependency('aruba')
21
21
  s.add_runtime_dependency('gli','2.18.1')
22
+ s.add_runtime_dependency('waitutil')
22
23
  end
@@ -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
@@ -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}\"").to_i
24
+ Integer(context.run("get pod #{name} -o jsonpath=\"#{json_path}\""))
25
25
  rescue StandardError
26
26
  nil
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module K8sKit
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
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.5
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: 2019-08-09 00:00:00.000000000 Z
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.0.3
138
+ rubygems_version: 3.1.2
125
139
  signing_key:
126
140
  specification_version: 4
127
141
  summary: A description of your project