kube_deploy_tools 3.0.8 → 3.0.9

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
  SHA256:
3
- metadata.gz: 2764c75eb39affece98b0e7e9b18a7e74be77ba578001a8dc29c0b4a8e792ed5
4
- data.tar.gz: 4371bcf67ecd0f3108b2e179a3b2262b4d70aaeda0d73b539db7147058b544d3
3
+ metadata.gz: 647bca1b43df72e42a02b1177678afd9f05c1c14f923a924ae62a573080928fa
4
+ data.tar.gz: 98d5c912c3890ad176b2b57035ff63b677cf44728bce05b34b7e9853ba8a21fb
5
5
  SHA512:
6
- metadata.gz: 685001b5b61b49a1e9da42dcd5c25cb9219272d61e091563c9fb8595e95832942900f065a7c49dc9de13d22a2385c704c43760bd2a50a92db6420ff04152eb54
7
- data.tar.gz: 3e00ecc582952ce6cb8643327cee3776fd3c00f83be8f1b13d02defe21f5a7d5b70fa258a0274e0b2b5b1c3a3e45ca5ab1feb604d4ad493059f16b92c1c92a27
6
+ metadata.gz: d5d4d909e52925fcda3b36878f8ab9540efe2675814214e5ec8e5b5c0536fc2be629122b704c3a9bd009d8d612853f3ee22c9f37e91c51cdd77d713da8341dcb
7
+ data.tar.gz: a63cda5c818c5e0930745adcd67747c8d46ab4635ebd9adbbb1b84306fb24067bdc4a5633c34f06b3f91099008593c46fb4c709fac7ed6901e6d50875d603650
data/README.md CHANGED
@@ -132,5 +132,9 @@ bundle exec kdt generate
132
132
  ```
133
133
 
134
134
  We accept [pull requests]. They will be reviewed by a member of the LiveRamp development team as soon as possible.
135
+ Once the PR is merged, GitHub will auto-draft the release. Be sure to
136
+ add the same version as a tag (vX.Y.Z) and then publish it.
137
+ [GitHub Workflow] will then publish the gems.
135
138
 
139
+ [GitHub Workflow]: https://github.com/LiveRamp/kube_deploy_tools/blob/master/.github/workflows/release.yml
136
140
  [pull requests]: https://github.com/LiveRamp/kube_deploy_tools/pulls
@@ -2,6 +2,9 @@ require 'optparse'
2
2
 
3
3
  require 'kube_deploy_tools/object'
4
4
 
5
+ # As of kubernetes 1.23 valid dry-run options are: none, client, server.
6
+ VALID_DRY_RUN_VALUES = %w[none client server].freeze
7
+
5
8
  module KubeDeployTools
6
9
  class Deploy::Optparser
7
10
  class Options
@@ -21,7 +24,7 @@ module KubeDeployTools
21
24
  def initialize
22
25
  self.project = File.basename(`git config remote.origin.url`.chomp, '.git')
23
26
  self.flavor = 'default'
24
- self.dry_run = true
27
+ self.dry_run = 'client'
25
28
  self.glob_files = []
26
29
  end
27
30
 
@@ -54,8 +57,19 @@ module KubeDeployTools
54
57
  self.build_number = p
55
58
  end
56
59
 
57
- parser.on('--dry-run DRY_RUN', TrueClass, "If true, will only dry-run apply Kubernetes manifests without sending them to the apiserver. Default is dry-run mode: #{dry_run}.") do |p|
58
- self.dry_run = p
60
+ # As of kubernetes 1.23 valid dry-run options are: none, client, server.
61
+ # Legacy values map accordingly: true => client, false => none
62
+ parser.on('--dry-run DRY_RUN', "Will only dry-run apply Kubernetes manifests without sending them to the apiserver. Default is dry-run mode: #{dry_run}. Must be '#{VALID_DRY_RUN_VALUES}'") do |p|
63
+ legacy_mapping = { 'true' => 'client', 'false' => 'none' }
64
+
65
+ if legacy_mapping.include?(p) then
66
+ self.dry_run = legacy_mapping[p]
67
+ Logger.warn("#{p} is no longer a supported dry-run value. Setting to value '#{self.dry_run}'.")
68
+ elsif VALID_DRY_RUN_VALUES.include?(p)
69
+ self.dry_run = p
70
+ else
71
+ raise ArgumentError, "#{p} is not a valid dry-run value. Expect one of '#{VALID_DRY_RUN_VALUES.join(', ')}'"
72
+ end
59
73
  end
60
74
 
61
75
  parser.on('--include INCLUDE', "Include glob pattern. Example: --include=**/* will include every file. Default is ''.") do |p|
@@ -64,10 +64,9 @@ module KubeDeployTools
64
64
  end
65
65
 
66
66
  def do_deploy(dry_run)
67
- success = false
68
67
  Logger.reset
69
68
  Logger.phase_heading('Initializing deploy')
70
- Logger.warn('Running in dry-run mode') if dry_run
69
+ Logger.warn('Running in dry-run mode') if dry_run != 'none'
71
70
 
72
71
  if !@namespace.nil? && @namespace != 'default'
73
72
  Logger.warn("Deploying to non-default Namespace: #{@namespace}")
@@ -98,7 +97,7 @@ module KubeDeployTools
98
97
  success
99
98
  end
100
99
 
101
- def run(dry_run: true)
100
+ def run(dry_run: 'client')
102
101
  do_deploy(dry_run)
103
102
  end
104
103
 
@@ -161,7 +160,7 @@ module KubeDeployTools
161
160
  raise FatalDeploymentError, "Template '#{filepath}' cannot be parsed"
162
161
  end
163
162
 
164
- def kubectl_apply(resources, dry_run: true)
163
+ def kubectl_apply(resources, dry_run: 'client')
165
164
  resources.each do |resource|
166
165
  @max_retries.times do |try|
167
166
  args = ['apply', '-f', resource.filepath, "--dry-run=#{dry_run}"]
@@ -1,3 +1,3 @@
1
1
  module KubeDeployTools
2
- VERSION = '3.0.8'
2
+ VERSION = '3.0.9'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kube_deploy_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabien Goncalves
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2020-10-27 00:00:00.000000000 Z
19
+ date: 2022-01-07 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: colorize
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.0.3
187
+ rubygems_version: 3.0.3.1
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Kubernetes Deploy Tools