krane 2.3.7 → 2.4.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
  SHA256:
3
- metadata.gz: dd1bb79abda9d85abeb1fcdc8a74d11643e45bc793e4d2b26968ca06630f59c4
4
- data.tar.gz: ac8a426ccd104579c100bcb45c114c6fbf686a3329b8cd8e540def30fc693d16
3
+ metadata.gz: 8100399551f3e460863aa36cd1be88385a4dc648701f53a0be2bf13005796b63
4
+ data.tar.gz: f5842c8d9d7f71ba9e7b0b5b2b16d956b4ba71931571d9badf3d7bc2a4eae846
5
5
  SHA512:
6
- metadata.gz: 9291109ec07bc72ea6508b4f0368690754a65f39298d4a338ad02fa62c13f4d8d44746f39214e03f04631f1b88367f91e38a23e8bc30d609f0dc4046bf7eed60
7
- data.tar.gz: f53a5e4cedbb7e804ae90a88c1c3e2044b87b16841ce921e90d0217f88499db71f7abba5f6ca8564275d3f7befe746528830b13d27da4ead0099cde4efd99a54
6
+ metadata.gz: 4ed454e7264750fd9b44ab0f3badbff014eb511b3ecd4696dce0b72cee7da2a0efdfac92a65214ead36fc336b941be6869e4282f47846e9dfbd2d9230a8a1607
7
+ data.tar.gz: 6be5ba46142a43dd1965dca486de1e42020b7aa7c9a806d21a150bb581598dfdf8bb203361be97072a6f7e18a6041335ce722073bc5cd6830f2444828c423484
@@ -11,24 +11,23 @@ jobs:
11
11
  fail-fast: false
12
12
  matrix:
13
13
  ruby:
14
- - '3.0' # With k8s 1.23
15
- - '3.0' # With k8s 1.22
16
- - '3.0' # With k8s 1.21
14
+ # Use unique Ruby versions, or GitHub gets confused when building the rest of the matrix
15
+ - '3.0.3' # With k8s 1.23
16
+ - '3.0.2' # With k8s 1.22
17
+ - '3.0.1' # With k8s 1.21
17
18
  - '3.0' # With k8s 1.20
18
19
  - '2.7' # With k8s 1.19
19
- - '2.6.6' # With k8s 1.18
20
- - '2.6.6' # With k8s 1.17
21
20
  include:
22
21
  # Match kind images with chosen version https://github.com/kubernetes-sigs/kind/releases
23
- - ruby: '3.0'
22
+ - ruby: '3.0.3'
24
23
  kind_version: 'v0.11.1'
25
24
  kubernetes_version: '1.23.0'
26
25
  kind_image: 'kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac'
27
- - ruby: '3.0'
26
+ - ruby: '3.0.2'
28
27
  kind_version: 'v0.11.1'
29
28
  kubernetes_version: '1.22.0'
30
29
  kind_image: 'kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047'
31
- - ruby: '3.0'
30
+ - ruby: '3.0.1'
32
31
  kind_version: 'v0.11.1'
33
32
  kubernetes_version: '1.21.1'
34
33
  kind_image: 'kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6'
@@ -40,14 +39,6 @@ jobs:
40
39
  kind_version: 'v0.11.1'
41
40
  kubernetes_version: '1.19.11'
42
41
  kind_image: 'kindest/node:v1.19.11@sha256:07db187ae84b4b7de440a73886f008cf903fcf5764ba8106a9fd5243d6f32729'
43
- - ruby: '2.6.6'
44
- kind_version: 'v0.11.1'
45
- kubernetes_version: '1.18.19'
46
- kind_image: '1.18: kindest/node:v1.18.19@sha256:7af1492e19b3192a79f606e43c35fb741e520d195f96399284515f077b3b622c'
47
- - ruby: '2.6.6'
48
- kind_version: 'v0.11.1'
49
- kubernetes_version: '1.17.17'
50
- kind_image: 'kindest/node:v1.17.17@sha256:66f1d0d91a88b8a001811e2f1054af60eef3b669a9a74f9b6db871f2f1eeed00'
51
42
 
52
43
  steps:
53
44
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## next
2
2
 
3
+ ## 2.4.0
4
+
5
+ *Enhancements*
6
+
7
+ - Ensure deploy tasks fail without at least one non-empty resource [#865](https://github.com/Shopify/krane/issues/865)
8
+
9
+ *Other*
10
+
11
+ - Remove Ruby 2.6 and K8s < 1.19 from the CI testing matrix. All fixtures have been updated to be compatible with K8s 1.22+.
12
+
13
+ ## 2.3.7
14
+
15
+ - isolated_execution_state active_support require for Rails 7+
16
+
3
17
  ## 2.3.6
4
18
 
5
19
  - Update kubeclient for better Ruby 3.1 compatibility.
data/README.md CHANGED
@@ -74,23 +74,23 @@ If you need the ability to render dynamic values in templates before deploying,
74
74
  ## Prerequisites
75
75
 
76
76
  * Ruby 2.6+
77
- * Your cluster must be running Kubernetes v1.15.0 or higher<sup>1</sup>
77
+ * Your cluster must be running Kubernetes v1.19.0 or higher<sup>1</sup>
78
78
 
79
79
  <sup>1</sup> We run integration tests against these Kubernetes versions. You can find our
80
80
  official compatibility chart below.
81
81
 
82
- | Kubernetes version | Last officially supported in gem version |
83
- | :----------------: | :-------------------: |
84
- | 1.5 | 0.11.2 |
85
- | 1.6 | 0.15.2 |
86
- | 1.7 | 0.20.6 |
87
- | 1.8 | 0.21.1 |
88
- | 1.9 | 0.24.0 |
89
- | 1.10 | 0.27.0 |
82
+ | Kubernetes version | Currently Tested? | Last officially supported in gem version |
83
+ |:------------------:|-------------------|:----------------------------------------:|
84
+ | 1.18 | No | 2.3.7 |
85
+ | 1.19 | Yes | -- |
86
+ | 1.20 | Yes | -- |
87
+ | 1.21 | Yes | -- |
88
+ | 1.22 | Yes | -- |
89
+ | 1.23 | Yes | -- |
90
90
 
91
91
  ## Installation
92
92
 
93
- 1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl) (requires v1.15.0 or higher) and make sure it is available in your $PATH
93
+ 1. [Install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl) (requires v1.19.0 or higher) and make sure it is available in your $PATH
94
94
  2. Set up your [kubeconfig file](https://kubernetes.io/docs/tasks/access-application-cluster/authenticate-across-clusters-kubeconfig/) for access to your cluster(s).
95
95
  3. `gem install krane`
96
96
 
data/dev.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: krane
3
3
  up:
4
- - ruby: 2.6.6 # Matches gemspec
4
+ - ruby: '3.0.3' # Matches gemspec
5
5
  - bundler
6
6
  - custom:
7
7
  name: Install Kubernetes in Docker (KinD)
@@ -13,7 +13,7 @@ up:
13
13
  - custom:
14
14
  name: Create KinD Cluster
15
15
  met?: bin/kind get clusters | grep -q krane
16
- meet: bin/kind create cluster --name krane
16
+ meet: bin/kind create cluster --name krane --image "kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047"
17
17
  down: |
18
18
  ((bin/kind get clusters | grep -q krane) && bin/kind delete cluster --name krane) || true
19
19
  commands:
@@ -254,6 +254,10 @@ module Krane
254
254
 
255
255
  StatsD.client.gauge('discover_resources.count', resources.size, tags: statsd_tags)
256
256
 
257
+ if resources.empty?
258
+ raise FatalDeploymentError, "No deployable resources were found!"
259
+ end
260
+
257
261
  resources.sort
258
262
  rescue InvalidTemplateError => e
259
263
  record_invalid_template(logger: @logger, err: e.message, filename: e.filename,
@@ -37,7 +37,10 @@ module Krane
37
37
 
38
38
  def group_version_kind
39
39
  group = @definition.dig("spec", "group")
40
- version = @definition.dig("spec", "version")
40
+ # Since 1.22: spec.version is removed in v1; use spec.versions instead.
41
+ # New spec here: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#create-a-customresourcedefinition
42
+ # This is only used in testing, so we will simply take the first version we see:
43
+ version = @definition.dig("spec", "versions", 0, "name")
41
44
  "#{group}/#{version}/#{kind}"
42
45
  end
43
46
 
@@ -48,6 +48,7 @@ module Krane
48
48
  end
49
49
 
50
50
  def has_side_effects?
51
+ # Note: After K8s 1.22, this should ALWAYS be false.
51
52
  !%w(None NoneOnDryRun).include?(side_effects)
52
53
  end
53
54
 
data/lib/krane/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Krane
3
- VERSION = "2.3.7"
3
+ VERSION = "2.4.0"
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.3.7
4
+ version: 2.4.0
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-01-11 00:00:00.000000000 Z
13
+ date: 2022-01-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport