helm_upgrade_logs 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/exe/helm_upgrade_logs +13 -3
- data/lib/helm_upgrade_logs/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff847ee96c1dbced9f3dbd122b6245f695fe599462d7e1899d1dd09e483051cf
|
4
|
+
data.tar.gz: a3b10b6e66cfbb71ddeb5490f9073fd868868cf9b0afb3e35c620f01ee17e6ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb0f2c697a023259f264cb6af3580a63f44448b025cb91400a8733b34ed3731e656807f40f52a376ac6688eb0fb287a73ec2b87c4cda23f257bfa30e8e797e4
|
7
|
+
data.tar.gz: '09bcd240fd9519e938c1fe0112907e922a57f21d2a67215f1f42270a8f67a6fecc5501cadd3968a07abaf4f2c73e358b77b79e95db976d2e44d132e51ac57ed0'
|
data/CHANGELOG.md
CHANGED
data/exe/helm_upgrade_logs
CHANGED
@@ -31,7 +31,7 @@ rescue Errno::ECHILD
|
|
31
31
|
raise HelmUpgradeLogs::Error, "Failed to find logs before helm finished"
|
32
32
|
end
|
33
33
|
|
34
|
-
FileUtils.mkdir_p
|
34
|
+
FileUtils.mkdir_p(UPGRADE_LOG_FOLDER) if ENV["helm_upgrade_logs_error_msg"]
|
35
35
|
|
36
36
|
while Process.waitpid(@helm_pid, Process::WNOHANG).nil?
|
37
37
|
pods = read_pods - pods_before_upgrade
|
@@ -46,11 +46,13 @@ while Process.waitpid(@helm_pid, Process::WNOHANG).nil?
|
|
46
46
|
std_out_pid = Process.spawn(
|
47
47
|
add_ns("kubectl logs #{pod} -f --all-containers --prefix --ignore-errors=true --timestamps=true")
|
48
48
|
)
|
49
|
+
@pod_pids["#{pod}_stdout"] = std_out_pid
|
50
|
+
next unless ENV["helm_upgrade_logs_error_msg"]
|
51
|
+
|
49
52
|
logfile_pid = Process.spawn(
|
50
53
|
add_ns("kubectl logs #{pod} -f --all-containers --prefix --ignore-errors=true --timestamps=true"),
|
51
54
|
out: "#{UPGRADE_LOG_FOLDER}/#{pod.gsub("/", "_")}.log"
|
52
55
|
)
|
53
|
-
@pod_pids["#{pod}_stdout"] = std_out_pid
|
54
56
|
@pod_pids["#{pod}_fileout"] = logfile_pid
|
55
57
|
end
|
56
58
|
end
|
@@ -59,12 +61,20 @@ end
|
|
59
61
|
puts "[INFO] Cleaning up loggers after helm upgrade"
|
60
62
|
helm_status = $CHILD_STATUS.exitstatus
|
61
63
|
Process.kill("KILL", event_pid)
|
64
|
+
Process.wait event_pid
|
62
65
|
Process.kill("KILL", service_pid)
|
63
|
-
|
66
|
+
Process.wait service_pid
|
67
|
+
|
68
|
+
if ENV["helm_upgrade_logs_debug"] == "true"
|
69
|
+
puts "[INFO] Log processes"
|
70
|
+
puts @pod_pids
|
71
|
+
end
|
64
72
|
@pod_pids.each do |_pod, pid|
|
65
73
|
puts "Terminating #{_pod} #{pid}" if ENV["helm_upgrade_logs_debug"] == "true"
|
66
74
|
Process.kill("KILL", pid)
|
75
|
+
Process.wait pid
|
67
76
|
end
|
77
|
+
puts `ps` if ENV["helm_upgrade_logs_debug"] == "true"
|
68
78
|
|
69
79
|
if ENV["helm_upgrade_logs_error_msg"]
|
70
80
|
pod_logs_files = Dir.glob("#{UPGRADE_LOG_FOLDER}/*.log")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helm_upgrade_logs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Garratt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Basic wrapper around helm and kubectl to allow easy debugging of a helm
|
14
14
|
release. All arguments after a usual helm upgrade are used as normal
|