helm_upgrade_logs 0.3.0 → 0.3.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: 88dd5b1832da012298b7c2f8ce393bcc78df7b20014bc9514b37d70bb3c885fe
4
- data.tar.gz: 4dd1b474d21f68ac9849d2523358e4550d518d81c0155d187cfe3b524b3236e7
3
+ metadata.gz: 2b0bd4dec8d15bd330ceb45ba82dc81e0a5ca0301c8032037462bd532ed6f75a
4
+ data.tar.gz: d4bd99f9a4d04e25b8f34089169f3355ac43d75081438aa3d8ed6854b0f787f6
5
5
  SHA512:
6
- metadata.gz: b6a0432ce7aee7a1a3b924e4599a0764674fb8ca3c61cab4862e51fefa57fe706dffeb15b3d9d134c22652fc65fbb5ccc4ae1e7383f78f65176bba50f93851b0
7
- data.tar.gz: 8ddfd48e160614b8d7e3b03c6eca7699ab05b96f2ad3ecdcaa00f71981bcf5a040796d2fc689503496c3906fc9dc6a6a1a03a652e63f2190024f8bebe7e12458
6
+ metadata.gz: c097c2af0698ad0c844c97c78f94498edafa94f66213d782a9fa9b5dc959cc6a0f9bf3ae11b39ce70860b7e91de92e00d4da6d0cd07b361145b4c6d04f118115
7
+ data.tar.gz: a8e3188650ec71f1a8de1c44c2f6105d02c09247e18feebbd2f625b898a9cc983f92c4eab9e0dec08d7daabd4e1298f720fc901a985be65658f274e5a8764c97
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.3.1]
2
+
3
+ - Fix LOG folder parsed to check error message
4
+
1
5
  ## [0.3.0]
2
6
 
3
7
  - Log output to a file in a folder `helm_upgrade_logs` as well as STDOUT
@@ -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 "helm_upgrade_logs"
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: "helm_upgrade_logs/#{pod.gsub("/", "_")}.log"
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("helm_logs/*.log")
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|
@@ -2,5 +2,5 @@
2
2
 
3
3
  module HelmUpgradeLogs
4
4
  # @return [String] Version of helm upgrade logs
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helm_upgrade_logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Garratt