dapp 0.14.6 → 0.14.7
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/config/en/net_status.yml +2 -1
- data/lib/dapp/kube/dapp/command/common.rb +16 -19
- data/lib/dapp/kube/dapp/command/deploy.rb +3 -2
- data/lib/dapp/kube/dapp/command/secret_edit.rb +1 -1
- data/lib/dapp/kube/dapp/command/secret_extract.rb +1 -1
- data/lib/dapp/kube/dapp/command/secret_generate.rb +1 -1
- data/lib/dapp/kube/dapp/command/secret_regenerate.rb +2 -1
- data/lib/dapp/version.rb +1 -1
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3e4aaab14d65724ea60299ceadd6e9b7c7af8ef
|
4
|
+
data.tar.gz: 09ddd9cf4d499ad1afe387d935e7338371f7f6f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc13b2da565927801e877745305c7f8b8ce24c3fbe7b8ecd5a116a33dcfe9f74c68bab163597f9822017b6398938d81275ab31ed30da3c75bb795624ff408e13
|
7
|
+
data.tar.gz: 8a7dce36cf64f25f11cc4f57a6edf0c7aee1e061c56f77f4fdfb8af00764e388487b5a98ff85c2b5f8556eb1f71edaf045f8b2fc886313730b0c5be8db3cc19e
|
data/config/en/net_status.yml
CHANGED
@@ -38,7 +38,8 @@ en:
|
|
38
38
|
file_not_exist: "File `%{path}` doesn't exist!"
|
39
39
|
helm_directory_not_exist: "Helm directory doesn't exist in project!"
|
40
40
|
values_file_not_found: "Values file `%{path}` not found!"
|
41
|
-
|
41
|
+
secret_file_not_found: "Secret file `%{path}` not found!"
|
42
|
+
secret_file_empty: "Secret file `%{path}` can't be empty!"
|
42
43
|
user_containers_detected: "User containers have been using images!\n%{ids}"
|
43
44
|
incorrect_yaml_structure: "Incorrect YAML structure in `%{path}`!"
|
44
45
|
editor_not_found: "Editor not found!"
|
@@ -8,35 +8,32 @@ module Dapp
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def kube_release_name
|
11
|
-
"#{name}-#{kube_namespace}"
|
11
|
+
"#{name}-#{kube_namespace}".slugify
|
12
12
|
end
|
13
13
|
|
14
14
|
def kube_namespace
|
15
15
|
kubernetes.namespace
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
{ encode: :generate, decode: :extract }.each do |type, secret_method|
|
19
|
+
define_method "kube_helm_#{type}_json" do |secret, json|
|
20
|
+
change_json_value = proc do |value|
|
21
|
+
case value
|
22
|
+
when Array then value.map { |v| change_json_value.call(v) }
|
23
|
+
when Hash then send(:"kube_helm_#{type}_json", secret, value)
|
24
|
+
when '' then ''
|
25
|
+
else
|
26
|
+
secret.nil? ? '' : secret.public_send(secret_method, value)
|
27
|
+
end
|
28
|
+
|
29
|
+
json.each { |k, v| json[k] = change_json_value.call(v) }
|
25
30
|
end
|
26
31
|
end
|
27
|
-
json.each { |k, v| json[k] = encode_json.call(v) }
|
28
32
|
end
|
29
33
|
|
30
|
-
def
|
31
|
-
|
32
|
-
|
33
|
-
when Array then value.map { |v| decode_value.call(v) }
|
34
|
-
when Hash then kube_helm_decode_json(secret,value)
|
35
|
-
else
|
36
|
-
secret.nil? ? '' : secret.extract(value)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
json.each { |k, v| json[k] = decode_value.call(v) }
|
34
|
+
def kube_secret_file_validate!(file_path)
|
35
|
+
raise Error::Command, code: :secret_file_not_found, data: { path: File.expand_path(file_path) } unless File.exist?(file_path)
|
36
|
+
raise Error::Command, code: :secret_file_empty, data: { path: File.expand_path(file_path) } if File.read(file_path).strip.empty?
|
40
37
|
end
|
41
38
|
|
42
39
|
def secret_key_should_exist!
|
@@ -63,7 +63,8 @@ module Dapp
|
|
63
63
|
def kube_helm_decode_secret_files
|
64
64
|
return unless kube_chart_secret_path.directory?
|
65
65
|
Dir.glob(kube_chart_secret_path.join('**/*')).each do |entry|
|
66
|
-
next
|
66
|
+
next if File.directory?(entry)
|
67
|
+
kube_secret_file_validate!(entry)
|
67
68
|
secret_relative_path = Pathname(entry).subpath_of(kube_chart_secret_path)
|
68
69
|
secret_data = secret.extract(IO.binread(entry).chomp("\n"))
|
69
70
|
File.open(kube_tmp_chart_secret_path(secret_relative_path), 'wb:ASCII-8BIT', 0400) {|f| f.write secret_data}
|
@@ -189,7 +190,7 @@ module Dapp
|
|
189
190
|
@kube_chart_secret_values_files ||= [].tap do |files|
|
190
191
|
files << kube_chart_secret_values_path if kube_chart_secret_values_path.file?
|
191
192
|
files.concat(options[:helm_secret_values_options].map { |p| Pathname(p).expand_path }.each do |f|
|
192
|
-
|
193
|
+
kube_secret_file_validate!(f)
|
193
194
|
end)
|
194
195
|
end
|
195
196
|
end
|
@@ -8,7 +8,7 @@ module Dapp
|
|
8
8
|
|
9
9
|
with_kube_tmp_chart_dir do
|
10
10
|
decoded_data = begin
|
11
|
-
|
11
|
+
kube_secret_file_validate!(file_path)
|
12
12
|
|
13
13
|
if options[:values]
|
14
14
|
kube_extract_secret_values(file_path)
|
@@ -8,7 +8,7 @@ module Dapp
|
|
8
8
|
|
9
9
|
data = begin
|
10
10
|
if file_path
|
11
|
-
|
11
|
+
kube_secret_file_validate!(file_path)
|
12
12
|
|
13
13
|
if options[:values]
|
14
14
|
kube_extract_secret_values(file_path)
|
@@ -8,7 +8,7 @@ module Dapp
|
|
8
8
|
|
9
9
|
data = begin
|
10
10
|
if file_path
|
11
|
-
|
11
|
+
kube_secret_file_validate!(file_path)
|
12
12
|
|
13
13
|
if options[:values]
|
14
14
|
kube_secret_values(file_path)
|
@@ -8,12 +8,13 @@ module Dapp
|
|
8
8
|
|
9
9
|
secret_values_paths << kube_chart_path('secret-values.yaml') if kube_chart_path('secret-values.yaml').file?
|
10
10
|
secret_values_paths.each do |file_path|
|
11
|
-
|
11
|
+
kube_secret_file_validate!(file_path)
|
12
12
|
regenerated_data[file_path] = kube_regenerate_secret_values(file_path)
|
13
13
|
end
|
14
14
|
|
15
15
|
Dir.glob(kube_chart_secret_path('**/*'), File::FNM_DOTMATCH).each do |file_path|
|
16
16
|
next if File.directory?(file_path)
|
17
|
+
kube_secret_file_validate!(file_path)
|
17
18
|
regenerated_data[file_path] = kube_regenerate_secret_file(file_path)
|
18
19
|
end
|
19
20
|
|
data/lib/dapp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Stolyarov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|
@@ -166,6 +166,26 @@ dependencies:
|
|
166
166
|
- - "~>"
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: 0.1.6
|
169
|
+
- !ruby/object:Gem::Dependency
|
170
|
+
name: slugify
|
171
|
+
requirement: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - "~>"
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '1.0'
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 1.0.6
|
179
|
+
type: :runtime
|
180
|
+
prerelease: false
|
181
|
+
version_requirements: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - "~>"
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '1.0'
|
186
|
+
- - ">="
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: 1.0.6
|
169
189
|
- !ruby/object:Gem::Dependency
|
170
190
|
name: bundler
|
171
191
|
requirement: !ruby/object:Gem::Requirement
|
@@ -686,7 +706,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
686
706
|
version: 2.5.0
|
687
707
|
requirements: []
|
688
708
|
rubyforge_project:
|
689
|
-
rubygems_version: 2.6.
|
709
|
+
rubygems_version: 2.6.13
|
690
710
|
signing_key:
|
691
711
|
specification_version: 4
|
692
712
|
summary: Build docker packaged apps using chef or shell
|