kcu 0.6.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cd2bdb8867688bc5c28227259ec87b9ef6791e3
4
- data.tar.gz: b038c1b68f71d4111ef5b5d923158c5c45c3cd8a
3
+ metadata.gz: 7fdc00eb4204d8e05682da212b4dd164ac7bf461
4
+ data.tar.gz: 8bfbc73f2942c6136d64b5ac46972f63b9cf066b
5
5
  SHA512:
6
- metadata.gz: 829bb99cdb6a71a1606f204c6dfcea3d1c2bf0ace45c49c3e6b632e17f89b2435e320ca06a552882d9988b9dc0f2dac0f8724f4dd7f7488a1fbbe0aa38c930cd
7
- data.tar.gz: cb061087f64fd6e930a400fde8ae26955ac3746d9400e82aa852aeb642f250cac5c7f9edbe554f1ac494b6c3d0ca23bf6abcf02939a54b490d1fc6a0f90917fb
6
+ metadata.gz: a60736972aa16fef15f38f9d15359c58998fbc2538cc2ec93f8e37066b83a49a89a8c3f3ea2a9ada66df0bd53283f622e9feafb319511918c550f00e6183d2f8
7
+ data.tar.gz: 6fda6fbf918de0addc59ea36fc23564787a2a636e0554377877c5739be442d8c6314457435cf4f439f5e1ce47361b9f075dfd59c5b3f74383dc0989428adda47
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.7.0] - 2017-02-01
8
+ ### Added
9
+ - Set secret from file
10
+
7
11
  ## [0.6.0] - 2018-02-01
8
12
  ### Added
9
13
  - Secret is created if it cannot be patched/updated
data/lib/kcu.rb CHANGED
@@ -23,6 +23,7 @@ require "kcu/services/secrets/decode_data"
23
23
  require "kcu/services/secrets/get_entry_value"
24
24
  require "kcu/services/secrets/encode_entry_value"
25
25
  require "kcu/services/secrets/set_entry_value"
26
+ require "kcu/services/secrets/read_entry_value"
26
27
  require "kcu/services/secrets/create_entry_value"
27
28
  require "kcu/services/deployments/restart_deployment"
28
29
  require "kcu/services/deploys/get_config"
@@ -3,13 +3,15 @@ module Kcu
3
3
 
4
4
  extend LightService::Organizer
5
5
 
6
- def self.call(resource, entry_name, entry_value)
6
+ def self.call(args, options)
7
7
  ctx = with({
8
- resource: resource,
9
- entry_name: entry_name,
10
- entry_value: entry_value,
8
+ resource: args[0],
9
+ entry_name: args[1],
10
+ entry_value: args[2],
11
+ options: options,
11
12
  }).reduce(
12
13
  GetResourceNamespaceAndName,
14
+ Secrets::ReadEntryValue,
13
15
  Secrets::EncodeEntryValue,
14
16
  Secrets::SetEntryValue,
15
17
  Secrets::CreateEntryValue,
@@ -27,10 +27,11 @@ module Kcu
27
27
  end
28
28
 
29
29
  command :"secret set" do |c|
30
- c.syntax = "secret set namespace/secret_name entry_name value"
30
+ c.syntax = "secret set namespace/secret_name entry_name [value or --from-file=/path]"
31
31
  c.description = "Set an entry in a secret by giving a non-base64 encoded value"
32
+ c.option "--from-file String", String, "Uses contents of file as the value. `kcu secret set namespace/secret_name entry_name --from-file=/tmp/config.cfg`"
32
33
  c.action do |args, options|
33
- SetSecretAction.(*args)
34
+ SetSecretAction.(args, options)
34
35
  end
35
36
  end
36
37
 
@@ -0,0 +1,15 @@
1
+ module Kcu
2
+ module Secrets
3
+ class ReadEntryValue
4
+
5
+ extend LightService::Action
6
+ expects :entry_value, :options
7
+ promises :entry_value
8
+
9
+ executed do |c|
10
+ c.entry_value ||= File.read(File.expand_path(c.options.from_file))
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Kcu
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kcu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
@@ -210,6 +210,7 @@ files:
210
210
  - lib/kcu/services/secrets/encode_entry_value.rb
211
211
  - lib/kcu/services/secrets/get_entry_value.rb
212
212
  - lib/kcu/services/secrets/get_json.rb
213
+ - lib/kcu/services/secrets/read_entry_value.rb
213
214
  - lib/kcu/services/secrets/set_entry_value.rb
214
215
  - lib/kcu/summary.rb
215
216
  - lib/kcu/version.rb