helm_upgrade_logs 0.1.6 → 0.1.7
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/get_pods.rb +7 -0
- data/lib/helm_upgrade_logs/version.rb +1 -1
- data/lib/helm_upgrade_logs.rb +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 612089e7637694fdb0bca10be78d1cda044a99c3925a436867f0c7efd7ab5813
|
4
|
+
data.tar.gz: 0c83667889b979ca3bcd7ccf54d74ffe5c16e750de625977c117cbd53d25b536
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1edb515198878e0f9602001bc08ba9018d657b4c1efc569a0b2e46c57ba10395a81a578cd0c57ae300ab6aee01d4e2dcd62550c1203cb64cb66cd8de3f7d7d4f
|
7
|
+
data.tar.gz: 652c953b9d59e33a58d54d880a86be9058822ca286266735016d0a1a8fffa7fc41fc51537aca66db7d24e9531fb47009336c245ed32900caec141164fbc47805
|
data/CHANGELOG.md
CHANGED
data/exe/helm_upgrade_logs
CHANGED
@@ -13,9 +13,19 @@ event_pid = Process.spawn 'kubectl get events --watch-only=true'
|
|
13
13
|
service_pid = Process.spawn 'kubectl get services --watch-only=true'
|
14
14
|
|
15
15
|
wait_for_pod_to_log
|
16
|
-
log_pid = Process.spawn "kubectl logs -lapp.kubernetes.io/managed-by=Helm,app.kubernetes.io/instance=#{$release_name} -f --all-containers --prefix --ignore-errors=true --max-log-requests=20 --timestamps=true --pod-running-timeout=300s"
|
17
16
|
|
18
|
-
|
19
|
-
|
17
|
+
@pods = []
|
18
|
+
|
19
|
+
while Process.waitpid(helm_pid, Process::WNOHANG) == nil do
|
20
|
+
pods = get_pods
|
21
|
+
if pods != @pods
|
22
|
+
@pods = pods
|
23
|
+
puts "[INFO] Pods: #{pods.join(',')}"
|
24
|
+
puts `kill #{@log_pid}` if @log_pid
|
25
|
+
@log_pid = Process.spawn "kubectl logs -lapp.kubernetes.io/managed-by=Helm,app.kubernetes.io/instance=#{$release_name} -f --all-containers --prefix --ignore-errors=true --max-log-requests=20 --timestamps=true --since=0s"
|
26
|
+
end
|
27
|
+
sleep 2.5
|
28
|
+
end
|
29
|
+
puts `kill #{@log_pid}`
|
20
30
|
puts `kill #{event_pid}`
|
21
31
|
puts `kill #{service_pid}`
|
data/get_pods.rb
ADDED
data/lib/helm_upgrade_logs.rb
CHANGED
@@ -24,6 +24,15 @@ def wait_for_pod_to_log
|
|
24
24
|
}
|
25
25
|
end
|
26
26
|
|
27
|
+
def get_pods
|
28
|
+
stdout, stderr, _ = Open3.capture3 "kubectl get pods -lapp.kubernetes.io/managed-by=Helm,app.kubernetes.io/instance=#{$release_name} -o name"
|
29
|
+
if stderr.empty?
|
30
|
+
stdout.lines.collect { |pod| pod.strip }
|
31
|
+
else
|
32
|
+
[]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
27
36
|
module HelmUpgradeLogs
|
28
37
|
class Error < StandardError; end
|
29
38
|
# Your code goes here...
|
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.1.
|
4
|
+
version: 0.1.7
|
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-04-
|
11
|
+
date: 2022-04-20 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
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- bin/start_kind.sh
|
42
42
|
- exe/helm_test_logs
|
43
43
|
- exe/helm_upgrade_logs
|
44
|
+
- get_pods.rb
|
44
45
|
- helm_upgrade_logs.gemspec
|
45
46
|
- lib/helm_upgrade_logs.rb
|
46
47
|
- lib/helm_upgrade_logs/version.rb
|