helm_upgrade_logs 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/exe/helm_upgrade_logs +5 -3
- data/lib/helm_upgrade_logs/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b0bd4dec8d15bd330ceb45ba82dc81e0a5ca0301c8032037462bd532ed6f75a
|
4
|
+
data.tar.gz: d4bd99f9a4d04e25b8f34089169f3355ac43d75081438aa3d8ed6854b0f787f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c097c2af0698ad0c844c97c78f94498edafa94f66213d782a9fa9b5dc959cc6a0f9bf3ae11b39ce70860b7e91de92e00d4da6d0cd07b361145b4c6d04f118115
|
7
|
+
data.tar.gz: a8e3188650ec71f1a8de1c44c2f6105d02c09247e18feebbd2f625b898a9cc983f92c4eab9e0dec08d7daabd4e1298f720fc901a985be65658f274e5a8764c97
|
data/CHANGELOG.md
CHANGED
data/exe/helm_upgrade_logs
CHANGED
@@ -5,6 +5,7 @@ require "open3"
|
|
5
5
|
require "fileutils"
|
6
6
|
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
7
7
|
require "helm_upgrade_logs"
|
8
|
+
UPGRADE_LOG_FOLDER = "helm_upgrade_logs"
|
8
9
|
|
9
10
|
@release_name = ARGV.find { |arg| !arg.start_with?("-") }
|
10
11
|
@namespace = namespace_from_args(ARGV)
|
@@ -30,7 +31,7 @@ rescue Errno::ECHILD
|
|
30
31
|
raise HelmUpgradeLogs::Error, "Failed to find logs before helm finished"
|
31
32
|
end
|
32
33
|
|
33
|
-
FileUtils.mkdir_p
|
34
|
+
FileUtils.mkdir_p UPGRADE_LOG_FOLDER
|
34
35
|
|
35
36
|
while Process.waitpid(@helm_pid, Process::WNOHANG).nil?
|
36
37
|
pods = read_pods - pods_before_upgrade
|
@@ -47,7 +48,7 @@ while Process.waitpid(@helm_pid, Process::WNOHANG).nil?
|
|
47
48
|
)
|
48
49
|
logfile_pid = Process.spawn(
|
49
50
|
add_ns("kubectl logs #{pod} -f --all-containers --prefix --ignore-errors=true --timestamps=true"),
|
50
|
-
out: "
|
51
|
+
out: "#{UPGRADE_LOG_FOLDER}/#{pod.gsub("/", "_")}.log"
|
51
52
|
)
|
52
53
|
@pod_pids["#{pod}_stdout"] = std_out_pid
|
53
54
|
@pod_pids["#{pod}_fileout"] = logfile_pid
|
@@ -65,7 +66,8 @@ puts @pod_pids if ENV["helm_upgrade_logs_debug"] == "true"
|
|
65
66
|
end
|
66
67
|
|
67
68
|
if ENV["helm_upgrade_logs_error_msg"]
|
68
|
-
pod_logs_files = Dir.glob("
|
69
|
+
pod_logs_files = Dir.glob("#{UPGRADE_LOG_FOLDER}/*.log")
|
70
|
+
puts "Reading logs from #{pod_logs_files.count} pod logs" if ENV["helm_upgrade_logs_debug"] == "true"
|
69
71
|
pod_logs_files.each do |log_file|
|
70
72
|
lines = File.readlines log_file
|
71
73
|
lines.each_with_index do |line, index|
|