kcu 0.5.0 → 0.6.0

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
  SHA1:
3
- metadata.gz: 844d0ee3c8ca0b2ce6e5340418fecc7c6615ed36
4
- data.tar.gz: d5b2e6346dfac9c4b74cf12934b6520e52974b1d
3
+ metadata.gz: 7cd2bdb8867688bc5c28227259ec87b9ef6791e3
4
+ data.tar.gz: b038c1b68f71d4111ef5b5d923158c5c45c3cd8a
5
5
  SHA512:
6
- metadata.gz: e5a6358af95e9f6b88e42956e48fb11b50ac3d93dc11dbeb9216928052860a8a8b0b07c1fb75076b6deb450d08b57d6fb9842038ea221cbe7fe2f157cd1b81dc
7
- data.tar.gz: 7e1e90121b538b3892a56eee996eae6b0bf92f38a837b42fc37e3a4b1754a70778f0ec2d4bf5985c539099d530fb68ece88edb01ce3f529e72caf960582e4861
6
+ metadata.gz: 829bb99cdb6a71a1606f204c6dfcea3d1c2bf0ace45c49c3e6b632e17f89b2435e320ca06a552882d9988b9dc0f2dac0f8724f4dd7f7488a1fbbe0aa38c930cd
7
+ data.tar.gz: cb061087f64fd6e930a400fde8ae26955ac3746d9400e82aa852aeb642f250cac5c7f9edbe554f1ac494b6c3d0ca23bf6abcf02939a54b490d1fc6a0f90917fb
@@ -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.6.0] - 2018-02-01
8
+ ### Added
9
+ - Secret is created if it cannot be patched/updated
10
+
7
11
  ## [0.5.0] - 2017-12-19
8
12
  ### Fixed
9
13
  - Fix wrong commit when deploying something other than master
data/lib/kcu.rb CHANGED
@@ -8,6 +8,7 @@ require "json"
8
8
  require "light-service"
9
9
  require "open3"
10
10
  require "to_regexp"
11
+ require "shellwords"
11
12
 
12
13
  module Kcu
13
14
  end
@@ -22,6 +23,7 @@ require "kcu/services/secrets/decode_data"
22
23
  require "kcu/services/secrets/get_entry_value"
23
24
  require "kcu/services/secrets/encode_entry_value"
24
25
  require "kcu/services/secrets/set_entry_value"
26
+ require "kcu/services/secrets/create_entry_value"
25
27
  require "kcu/services/deployments/restart_deployment"
26
28
  require "kcu/services/deploys/get_config"
27
29
  require "kcu/services/deploys/set_target_namespace"
@@ -12,6 +12,7 @@ module Kcu
12
12
  GetResourceNamespaceAndName,
13
13
  Secrets::EncodeEntryValue,
14
14
  Secrets::SetEntryValue,
15
+ Secrets::CreateEntryValue,
15
16
  )
16
17
  end
17
18
 
@@ -0,0 +1,34 @@
1
+ module Kcu
2
+ module Secrets
3
+ class CreateEntryValue
4
+
5
+ extend LightService::Action
6
+ expects(
7
+ :resource_namespace,
8
+ :resource_name,
9
+ :entry_name,
10
+ :entry_value,
11
+ )
12
+
13
+ executed do |c|
14
+ literal = [
15
+ c.entry_name,
16
+ Shellwords.escape(c.entry_value)
17
+ ].join("=")
18
+
19
+ stdout_str, stderr_str, status = ExecShell.(
20
+ "kubectl",
21
+ "create",
22
+ "secret",
23
+ "generic",
24
+ c.resource_name,
25
+ "--namespace" => c.resource_namespace,
26
+ "--from-literal" => literal,
27
+ )
28
+
29
+ puts stdout_str || stderr_str
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -26,7 +26,7 @@ module Kcu
26
26
  "--patch" => "'#{patch_json}'",
27
27
  )
28
28
 
29
- puts stdout_str
29
+ c.skip_remaining! if status.exitstatus.zero?
30
30
  end
31
31
 
32
32
  end
@@ -1,3 +1,3 @@
1
1
  module Kcu
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kcu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramon Tayag
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-19 00:00:00.000000000 Z
11
+ date: 2018-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -205,6 +205,7 @@ files:
205
205
  - lib/kcu/services/deploys/set_target_namespace.rb
206
206
  - lib/kcu/services/exec_shell.rb
207
207
  - lib/kcu/services/get_resource_namespace_and_name.rb
208
+ - lib/kcu/services/secrets/create_entry_value.rb
208
209
  - lib/kcu/services/secrets/decode_data.rb
209
210
  - lib/kcu/services/secrets/encode_entry_value.rb
210
211
  - lib/kcu/services/secrets/get_entry_value.rb