helmsnap 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/helmsnap/command.rb +6 -2
- data/lib/helmsnap/generate.rb +2 -2
- data/lib/helmsnap/setup_dependencies.rb +10 -5
- data/lib/helmsnap/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: d5e21c78125566f4355ae0679100331a32322034be84fcde8f72ba44397de8e2
|
4
|
+
data.tar.gz: da348e3a0651dd69d20e33555ddf547b8097057169eac3b1e678d4006ce90ff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb09555b7dc60d769d5a54df05740b9f50fe9e0542a6f1b3a85ce9c1cfcbba1a630bd079109e468620345757ca693b41b79345e737f8ce0a4a5f8f3272a3d02d
|
7
|
+
data.tar.gz: 59237f6806aa14d80335ccd6afaa08dd4f11398c930e5b3f491058d1cfc96a67f1303a22af3094e172cdb7b5ec43a1a1cc312799dd4fc245c932b47beb62600e
|
data/Gemfile.lock
CHANGED
data/lib/helmsnap/command.rb
CHANGED
@@ -7,8 +7,8 @@ class Helmsnap::Command < Helmsnap::Service
|
|
7
7
|
super()
|
8
8
|
self.cmd = cmd
|
9
9
|
self.output = +""
|
10
|
-
self.stdout = stdout
|
11
|
-
self.stderr = stderr
|
10
|
+
self.stdout = stdout || null_file
|
11
|
+
self.stderr = stderr || null_file
|
12
12
|
self.allow_failure = allow_failure
|
13
13
|
end
|
14
14
|
|
@@ -21,6 +21,10 @@ class Helmsnap::Command < Helmsnap::Service
|
|
21
21
|
|
22
22
|
attr_accessor :cmd, :output, :stdout, :stderr, :allow_failure
|
23
23
|
|
24
|
+
def null_file
|
25
|
+
File.open(File::NULL, "w")
|
26
|
+
end
|
27
|
+
|
24
28
|
def run_command
|
25
29
|
Open3.popen3(cmd) do |_in, out, err, wait_thr|
|
26
30
|
while (chunk = out.gets)
|
data/lib/helmsnap/generate.rb
CHANGED
@@ -20,22 +20,20 @@ class Helmsnap::SetupDependencies < Helmsnap::Service
|
|
20
20
|
dep_list = get_dependency_list(chart_path)
|
21
21
|
|
22
22
|
dep_list.scan(%r{file://(.+?)\t}) do |dep_path|
|
23
|
-
|
23
|
+
update_deps!(chart_path.join(dep_path.first))
|
24
24
|
end
|
25
25
|
|
26
26
|
dep_list.scan(%r{(https?://.+?)\t}) do |dep_path|
|
27
27
|
run_cmd("helm", "repo", "add", Digest::MD5.hexdigest(dep_path.first), dep_path.first)
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
update_deps!(chart_path)
|
31
31
|
end
|
32
32
|
|
33
33
|
def get_dependency_list(chart_path)
|
34
34
|
base_cmd = ["helm", "dependency", "list", chart_path]
|
35
35
|
|
36
|
-
result = run_cmd(
|
37
|
-
*base_cmd, "--max-col-width", 0, allow_failure: true, stderr: File.open(File::NULL, "w")
|
38
|
-
)
|
36
|
+
result = run_cmd(*base_cmd, "--max-col-width", 0, allow_failure: true, stderr: nil)
|
39
37
|
|
40
38
|
if result.success
|
41
39
|
result.output
|
@@ -47,4 +45,11 @@ class Helmsnap::SetupDependencies < Helmsnap::Service
|
|
47
45
|
end
|
48
46
|
end
|
49
47
|
end
|
48
|
+
|
49
|
+
def update_deps!(chart_path)
|
50
|
+
base_cmd = ["helm", "dependency", "update", chart_path]
|
51
|
+
result = run_cmd(*base_cmd, "--skip-refresh", allow_failure: true)
|
52
|
+
run_cmd(*base_cmd) unless result.success # Try with deps refresh in case of any failure
|
53
|
+
true
|
54
|
+
end
|
50
55
|
end
|
data/lib/helmsnap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helmsnap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|