kubes 0.8.4 → 0.8.5
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 +3 -0
- data/docs/_docs/helpers/aws/secret_data.md +1 -1
- data/docs/_docs/helpers/google/secret_data.md +1 -1
- data/lib/kubes/compiler/shared/helpers/config_map_helper.rb +3 -2
- data/lib/kubes/compiler/shared/helpers/secret_helper.rb +19 -3
- data/lib/kubes/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: 7d4f55863bc9b85ce81ef58001438359486ff5d04f8659cdb78a9129495e44f5
|
|
4
|
+
data.tar.gz: 47028f4b0ea54bdde4cbfc0dce71ace1c7a8a1ffdf895c745a595318120da9cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2b7d7e1d8f50a1c5a2900f2a8114219f79ad1e11b942cf4bc57970b4e44875bc7fe4389c99331396c7173c155fab75822e57044012f6446d4ae14f719177615
|
|
7
|
+
data.tar.gz: 4785cb4de213f738fa667f865c36b29636f1919e1dc46093c2d88e3cb8cf2c2472f77f8812279383419e3274da7186897519ccbc4a3107cccbcc67f53a294e26
|
data/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
|
5
5
|
|
|
6
|
+
## [0.8.5] - 2022-02-16
|
|
7
|
+
- [#61](https://github.com/boltops-tools/kubes/pull/61) add erb support for config_map_files and generic_secret_data helpers
|
|
8
|
+
|
|
6
9
|
## [0.8.4] - 2022-02-16
|
|
7
10
|
- bump kubes_aws and kubes_google dependencies
|
|
8
11
|
|
|
@@ -4,7 +4,7 @@ nav_text: Secrets Data
|
|
|
4
4
|
categories: helpers-aws
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
The `aws_secret_data` helper fetches secret data that is one single file from AWS Secrets.
|
|
7
|
+
The `aws_secret_data` helper fetches secret data that is designed to be in one single file from AWS Secrets.
|
|
8
8
|
|
|
9
9
|
## Example
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ nav_text: Secrets Data
|
|
|
4
4
|
categories: helpers-google
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
The `google_secret_data` helper fetches secret data that is one single file from Google Secrets.
|
|
7
|
+
The `google_secret_data` helper fetches secret data that is designed to be in one single file from Google Secrets.
|
|
8
8
|
|
|
9
9
|
## Example
|
|
10
10
|
|
|
@@ -18,9 +18,10 @@ module Kubes::Compiler::Shared::Helpers
|
|
|
18
18
|
data = {}
|
|
19
19
|
layers.each do |path|
|
|
20
20
|
next unless File.exist?(path)
|
|
21
|
-
|
|
21
|
+
text = RenderMePretty.result(path, context: self)
|
|
22
|
+
lines = text.split("\n")
|
|
22
23
|
lines.each do |line|
|
|
23
|
-
key, value = line
|
|
24
|
+
key, value = parse_env_like_line(line)
|
|
24
25
|
data[key] = value
|
|
25
26
|
end
|
|
26
27
|
end
|
|
@@ -6,17 +6,25 @@ module Kubes::Compiler::Shared::Helpers
|
|
|
6
6
|
indent = options[:indent] || 2
|
|
7
7
|
base64 = options[:base64].nil? ? true : options[:base64]
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
text = send(plugin_secret_method, name, base64: false)
|
|
10
|
+
path = create_generic_secret_data_temp_file(text)
|
|
11
|
+
text = RenderMePretty.result(path, context: self)
|
|
10
12
|
spacing = " " * indent
|
|
11
|
-
lines =
|
|
13
|
+
lines = text.split("\n")
|
|
12
14
|
new_lines = lines.map do |line|
|
|
13
|
-
key, value = line
|
|
15
|
+
key, value = parse_env_like_line(line)
|
|
14
16
|
value = encode64(value) if base64
|
|
15
17
|
"#{spacing}#{key}: #{value}"
|
|
16
18
|
end
|
|
17
19
|
new_lines.join("\n")
|
|
18
20
|
end
|
|
19
21
|
|
|
22
|
+
def parse_env_like_line(line)
|
|
23
|
+
key, *rest = line.split('=')
|
|
24
|
+
value = rest.join('=')
|
|
25
|
+
[key, value]
|
|
26
|
+
end
|
|
27
|
+
|
|
20
28
|
def encode64(v)
|
|
21
29
|
Base64.strict_encode64(v.to_s).strip
|
|
22
30
|
end
|
|
@@ -25,5 +33,13 @@ module Kubes::Compiler::Shared::Helpers
|
|
|
25
33
|
def decode64(v)
|
|
26
34
|
Base64.strict_decode64(v)
|
|
27
35
|
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
def create_generic_secret_data_temp_file(text)
|
|
39
|
+
path = "/tmp/kubes/text.erb"
|
|
40
|
+
FileUtils.mkdir_p(File.dirname(path))
|
|
41
|
+
IO.write(path, text)
|
|
42
|
+
path
|
|
43
|
+
end
|
|
28
44
|
end
|
|
29
45
|
end
|
data/lib/kubes/version.rb
CHANGED