kubernetes_template_rendering 0.2.1.pre.dc.6 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 687be8fde4f952b4f2a8eae636a807a19d6a8c609fbe34c198e6e7d20215ef91
|
4
|
+
data.tar.gz: 04ff6091e0c2382f7671cea095c25487cab558d6c5f73d510e0fdb9390c39ef4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae06721a86171782ecaae0fb867461966a22c0721d7ede3b4b112a4ea8d432854bc03517e83f267d4f3bcb0e3df00c7e08cfd6e2938c862e9b028c58bbdcc25f
|
7
|
+
data.tar.gz: c99dd7d94b00c794bf6b86dc1ca6856d0dab6755d982360b58b030f37935d52ba06f375aecf127375a70e1dd413934fb439ddec67908ad218c534f739bdb414e
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,7 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
5
5
|
Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [0.2.1] -
|
7
|
+
## [0.2.1] - 2024-06-17
|
8
8
|
### Fixed
|
9
9
|
- Fixed a bug allowing child process errors to be ignored while rendering.
|
10
10
|
|
@@ -28,6 +28,7 @@ module KubernetesTemplateRendering
|
|
28
28
|
|
29
29
|
def render(args)
|
30
30
|
child_pids = []
|
31
|
+
failed_processes = [] # [[pid, status]]
|
31
32
|
|
32
33
|
resource_sets.each do |name, resource_sets|
|
33
34
|
puts "Rendering templates for definition #{Color.red(name)}..."
|
@@ -36,7 +37,7 @@ module KubernetesTemplateRendering
|
|
36
37
|
if (pid = Process.fork)
|
37
38
|
# this is the parent
|
38
39
|
child_pids << pid
|
39
|
-
wait_if_max_forked(child_pids)
|
40
|
+
wait_if_max_forked(child_pids, failed_processes)
|
40
41
|
else
|
41
42
|
# this is the child
|
42
43
|
render_set(args, resource_set)
|
@@ -49,9 +50,11 @@ module KubernetesTemplateRendering
|
|
49
50
|
end
|
50
51
|
|
51
52
|
if args.fork?
|
52
|
-
|
53
|
+
Process.waitall.each do |pid, status|
|
54
|
+
status.success? or failed_processes << [pid, status]
|
55
|
+
end
|
53
56
|
|
54
|
-
if
|
57
|
+
if failed_processes.any?
|
55
58
|
raise "Child process completed with non-zero status: #{failed_processes.inspect}"
|
56
59
|
end
|
57
60
|
end
|
@@ -65,18 +68,18 @@ module KubernetesTemplateRendering
|
|
65
68
|
|
66
69
|
MAX_FORKED_PROCESSES = 9
|
67
70
|
|
68
|
-
def wait_if_max_forked(child_pids)
|
71
|
+
def wait_if_max_forked(child_pids, failed_processes)
|
69
72
|
while child_pids.size >= MAX_FORKED_PROCESSES
|
70
73
|
begin
|
71
74
|
pid, exit_status = Process.waitpid2 # this is a race condition because 1 or more processes could exit before we get here
|
72
|
-
exit_status.success? or
|
75
|
+
exit_status.success? or failed_processes << [pid, exit_status]
|
73
76
|
rescue SystemCallError # this will happen if they all exited before we called waitpid
|
74
77
|
end
|
75
78
|
child_pids.delete_if do |pid|
|
76
79
|
begin
|
77
80
|
_, exit_status = Process.waitpid2(pid, Process::WNOHANG)
|
78
|
-
if exit_status
|
79
|
-
|
81
|
+
if exit_status && !exit_status.success?
|
82
|
+
failed_processes << [pid, exit_status]
|
80
83
|
end
|
81
84
|
rescue Errno::ECHILD # No child processes
|
82
85
|
true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubernetes_template_rendering
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Octothorpe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -104,9 +104,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: 3.1.0
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - "
|
107
|
+
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubygems_version: 3.3.26
|
112
112
|
signing_key:
|