kubes_google 0.3.1 → 0.3.2

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: c00e66f307251f8ea29d5ba9f624197a31f7c914615925816f5086b1948d6122
4
- data.tar.gz: 75e4cfc3a285162e64ef6e0ae68b79e55f6491774cc18e3c510f7c83feed8d1f
3
+ metadata.gz: e286468a570668c5d92665f0966165c18f987de7bc09a27c0527d4e732ba3cc0
4
+ data.tar.gz: 5f36b3d707942e78160a677dcb3dd9b936bba513d43b61d20176486cacf201ba
5
5
  SHA512:
6
- metadata.gz: 95d854c940d876be88544ce89e4eb67c0a85989b279bdfa42f3b7fb504f291650283c2b18f9deec03e5f35cb9d977dcd0e19497cb9a4da805d445c2a779ea88c
7
- data.tar.gz: 2a7648e2f8f2aeb14dd3e8d9beb4fd920512269a8bf6dcd03ec8dce6f118731ccfafc60437b785382001691ea5d22516562338a6cfb01092f5479feb2d8ed3be
6
+ metadata.gz: 0c86e64af5fd59083820f5a34ae59ad3ee323ae038e5f99ecb63900ffe41701c5ae5e1b661117f210153eacc151cc01e44681e63292e9b059802ae1916aa9dcb
7
+ data.tar.gz: 572b87da4fc774078994cce80eea09a4a3ca74d445f605fb286958c1ecf0eb0ea4210d7ed30b713d160c46f06acecc6e757652d79e7e9d00d4d58afd00291922
@@ -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.3.2] - 2020-11-11
7
+ - [#5](https://github.com/boltops-tools/kubes_google/pull/5) config.base64 option
8
+
6
9
  ## [0.3.1] - 2020-11-11
7
10
  - [#4](https://github.com/boltops-tools/kubes_google/pull/4) get_credentials hook
8
11
 
@@ -4,9 +4,13 @@ module KubesGoogle
4
4
 
5
5
  def defaults
6
6
  c = ActiveSupport::OrderedOptions.new
7
+ c.base64_secrets = true
7
8
  c.gke = ActiveSupport::OrderedOptions.new
8
9
  c.gke.cluster_name = nil
10
+ c.gke.enable_get_credentials = nil
9
11
  c.gke.enable_hooks = nil # nil since need cluster_name also. setting to false will explicitly disable hooks
12
+ c.gke.google_project = nil
13
+ c.gke.google_region = nil
10
14
  c.gke.whitelist_ip = nil # default will auto-detect IP
11
15
  c
12
16
  end
@@ -5,16 +5,20 @@ class KubesGoogle::Secrets
5
5
 
6
6
  def initialize(options={})
7
7
  @options = options
8
- @base64 = options[:base64].nil? ? true : options[:base64]
8
+ @base64 = options[:base64]
9
9
  @project_id = ENV['GOOGLE_PROJECT'] || raise("GOOGLE_PROJECT env variable is not set. It's required.")
10
10
  end
11
11
 
12
12
  def fetch(short_name)
13
13
  value = fetch_value(short_name)
14
- value = Base64.strict_encode64(value).strip if @base64
14
+ value = Base64.strict_encode64(value).strip if base64?
15
15
  value
16
16
  end
17
17
 
18
+ def base64?
19
+ @base64.nil? ? KubesGoogle.config.base64_secrets : @base64
20
+ end
21
+
18
22
  def fetch_value(short_name)
19
23
  name = "projects/#{project_number}/secrets/#{short_name}/versions/latest"
20
24
  version = secret_manager_service.access_secret_version(name: name)
@@ -1,3 +1,3 @@
1
1
  module KubesGoogle
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubes_google
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen