krane 2.4.6 → 2.4.7

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: 3efffadcb3741041089702a861ec5895261b3a47a4b3bee3ab2290f2d47b237e
4
- data.tar.gz: fd9d8eda29c43146a4754e55321e0546244ef79ce67d534895b5c159b55399e2
3
+ metadata.gz: 4ea2d6805d4bcb71c3d3f70d99cb27a6bd392636a19077cea322f782e815b072
4
+ data.tar.gz: a7aaf751e8d1de0f47006b41bd115615f49b2ba05ff1486447e3747bd467722b
5
5
  SHA512:
6
- metadata.gz: e5f7a84718bf3be365a9947cbb7124f2ca6df5967dd39694ce0882bbfd620e488e91610ccc284d33a04d0af2471b3fc11f42b79853db0c20e87b6babc69adeb2
7
- data.tar.gz: 57ed1f07880d46fd2bf5388bb7ae9bb3bb5f50aa4ec001e7d095d9cadf66e01952f0082bc3bd3f0115dcab3afa531f07d709404c6cfcafc93941a48a55941fbb
6
+ metadata.gz: b6f742a8c88c993c9c255ce27ae1419989e03810a21cc656bcc6b0766496b0fdeed7ead385e97d30a77c5c03b56c3fac5039e5c2556ed8ceb4a04a6fca31f7e1
7
+ data.tar.gz: 9ec49b7ffdacf6a58a1e498c1c17be51a2a2c063c613d5ecb391d704383803d3b8911e91bcca125e14fa03b82252ad3e040511e9cc7c632506a9074cd2dafff3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## next
2
2
 
3
+ ## 2.4.7
4
+
5
+ *Bug fixes*
6
+
7
+ - Fix `replace-force` deployment method override.
8
+ ```
9
+ /usr/local/bundle/gems/krane-2.4.6/lib/krane/resource_deployer.rb:119:in `block in deploy_resources': Unexpected deploy method! (:"replace-force") (ArgumentError)
10
+ ```
11
+ Dash (-) must be replaced with underscore (_) before applying it as method on kubernetes resource.
12
+
3
13
  ## 2.4.6
4
14
 
5
15
  *Bug fixes*
data/lib/krane/kubectl.rb CHANGED
@@ -82,9 +82,17 @@ module Krane
82
82
  def version_info
83
83
  @version_info ||=
84
84
  begin
85
- response, _, status = run("version", use_namespace: false, log_failure: true, attempts: 2)
85
+ response, _, status = run("version", output: "json", use_namespace: false, log_failure: true, attempts: 2)
86
86
  raise KubectlError, "Could not retrieve kubectl version info" unless status.success?
87
- extract_version_info_from_kubectl_response(response)
87
+
88
+ version_data = JSON.parse(response)
89
+ client_version = platform_agnostic_version(version_data.dig("clientVersion", "gitVersion").to_s)
90
+ server_version = platform_agnostic_version(version_data.dig("serverVersion", "gitVersion").to_s)
91
+ unless client_version && server_version
92
+ raise KubectlError, "Received invalid kubectl version data: #{version_data}"
93
+ end
94
+
95
+ { client: client_version, server: server_version }
88
96
  end
89
97
  end
90
98
 
@@ -127,15 +135,10 @@ module Krane
127
135
  end
128
136
  end
129
137
 
130
- def extract_version_info_from_kubectl_response(response)
131
- info = {}
132
- response.each_line do |l|
133
- match = l.match(/^(?<kind>Client|Server).* GitVersion:"v(?<version>\d+\.\d+\.\d+)/)
134
- if match
135
- info[match[:kind].downcase.to_sym] = Gem::Version.new(match[:version])
136
- end
138
+ def platform_agnostic_version(version_string)
139
+ if match = version_string.match(/v(?<version>\d+\.\d+\.\d+)/)
140
+ Gem::Version.new(match[:version])
137
141
  end
138
- info
139
142
  end
140
143
  end
141
144
  end
@@ -250,7 +250,7 @@ module Krane
250
250
  end
251
251
 
252
252
  def deploy_method_override
253
- krane_annotation_value(DEPLOY_METHOD_OVERRIDE_ANNOTATION)&.to_sym
253
+ krane_annotation_value(DEPLOY_METHOD_OVERRIDE_ANNOTATION)&.gsub("-", "_")&.to_sym
254
254
  end
255
255
 
256
256
  def sync_debug_info(kubectl)
data/lib/krane/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Krane
3
- VERSION = "2.4.6"
3
+ VERSION = "2.4.7"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: krane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.6
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Verey
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-04-05 00:00:00.000000000 Z
13
+ date: 2022-05-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport