krane 2.4.4 → 2.4.7
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 +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/krane/kubectl.rb +13 -10
- data/lib/krane/kubernetes_resource/pod.rb +5 -1
- data/lib/krane/kubernetes_resource.rb +1 -1
- data/lib/krane/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ea2d6805d4bcb71c3d3f70d99cb27a6bd392636a19077cea322f782e815b072
|
4
|
+
data.tar.gz: a7aaf751e8d1de0f47006b41bd115615f49b2ba05ff1486447e3747bd467722b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6f742a8c88c993c9c255ce27ae1419989e03810a21cc656bcc6b0766496b0fdeed7ead385e97d30a77c5c03b56c3fac5039e5c2556ed8ceb4a04a6fca31f7e1
|
7
|
+
data.tar.gz: 9ec49b7ffdacf6a58a1e498c1c17be51a2a2c063c613d5ecb391d704383803d3b8911e91bcca125e14fa03b82252ad3e040511e9cc7c632506a9074cd2dafff3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,29 @@
|
|
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
|
+
|
13
|
+
## 2.4.6
|
14
|
+
|
15
|
+
*Bug fixes*
|
16
|
+
|
17
|
+
- Extend [#886](https://github.com/Shopify/krane/pull/886) to not only secrets but anything that doesn't match `failed to sync %s cache` [#886](https://github.com/Shopify/krane/pull/886)
|
18
|
+
It seems an issue when too many pods are referencing the same secret/configmap https://github.com/kubernetes/kubernetes/pull/74755, so instead of failing fast, it'll now let the resources attempt to succeed.
|
19
|
+
- Add missing unit test for above feature.
|
20
|
+
|
21
|
+
## 2.4.5
|
22
|
+
|
23
|
+
*Bug fixes*
|
24
|
+
|
25
|
+
- Do not fail fast for CreateContainerConfigError when message include issues mounting the secret, to let the pods be recreated and possible succeed [#885](https://github.com/Shopify/krane/pull/885)
|
26
|
+
|
3
27
|
## 2.4.4
|
4
28
|
|
5
29
|
*Enhancements*
|
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
|
-
|
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
|
131
|
-
|
132
|
-
|
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
|
@@ -229,7 +229,11 @@ module Krane
|
|
229
229
|
elsif limbo_reason == "ErrImagePull" && limbo_message.match(/not found/i)
|
230
230
|
"Failed to pull image #{@image}. "\
|
231
231
|
"Did you wait for it to be built and pushed to the registry before deploying?"
|
232
|
-
|
232
|
+
# Only fail fast when message doesn't include `failed to sync %s cache`.
|
233
|
+
# It's possible that a secret/configmap is still trying to be mounted to the pod, it seems related
|
234
|
+
# to too many pods referencing the same secret/configmap: https://github.com/kubernetes/kubernetes/pull/74755
|
235
|
+
# Error message format source: https://github.com/kubernetes/kubernetes/pull/75260
|
236
|
+
elsif limbo_reason == "CreateContainerConfigError" && !limbo_message.match("failed to sync (.*?) cache")
|
233
237
|
"Failed to generate container configuration: #{limbo_message}"
|
234
238
|
elsif @status.dig("lastState", "terminated", "reason") == "ContainerCannotRun"
|
235
239
|
# ref: https://github.com/kubernetes/kubernetes/blob/562e721ece8a16e05c7e7d6bdd6334c910733ab2/pkg/kubelet/dockershim/docker_container.go#L353
|
@@ -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
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.
|
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-
|
13
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|