kubes 0.8.4 → 0.8.5

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: f78e6b8aa9788c03dbc38391b936a5792353249c5d9e743d7ebf87fc52c74488
4
- data.tar.gz: a77d273302faaf434f751f36305cfafc9e7e5e7491db010f1468088d4806f8b7
3
+ metadata.gz: 7d4f55863bc9b85ce81ef58001438359486ff5d04f8659cdb78a9129495e44f5
4
+ data.tar.gz: 47028f4b0ea54bdde4cbfc0dce71ace1c7a8a1ffdf895c745a595318120da9cd
5
5
  SHA512:
6
- metadata.gz: 1241bd270d3212d96a04b5e1edbd1085efee439105fff63896ec2b06dc84520e02ffbe7fd0830db246979c201c279c63adfcd41332e809cfbc3997b205a0459b
7
- data.tar.gz: 6382b7380c842621e54f388e7d66fcf981e407a3952928996148be0037d0321e14779ea79a016991c0b5d0b0c5c02dccfe9de3ef77a62295a62fe549fa2a335c
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
- lines = IO.readlines(path)
21
+ text = RenderMePretty.result(path, context: self)
22
+ lines = text.split("\n")
22
23
  lines.each do |line|
23
- key, value = line.split('=').map(&:strip)
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
- full_data = send(plugin_secret_method, name, base64: false)
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 = full_data.split("\n")
13
+ lines = text.split("\n")
12
14
  new_lines = lines.map do |line|
13
- key, value = line.split('=')
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
@@ -1,3 +1,3 @@
1
1
  module Kubes
2
- VERSION = "0.8.4"
2
+ VERSION = "0.8.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen