Skip to content

Commit

Permalink
v2.3.1 (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
timothysmith0609 committed Nov 15, 2021
1 parent d74dc7c commit 7510c33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## next

## 2.3.1

- Fix a bug in RestartTask where a NoMethodError is thrown if any of the target resources do not have annotations [#841](https://github.com/Shopify/krane/pull/841)

## 2.3.0

- Restart tasks now support restarting StatefulSets and DaemonSets, in addition to Deployments [#836](https://github.com/Shopify/krane/pull/836)
Expand Down
6 changes: 3 additions & 3 deletions lib/krane/restart_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def identify_target_deployments(selector: nil)
selector_string = selector.to_s
apps_v1_kubeclient.get_deployments(namespace: @namespace, label_selector: selector_string)
end
deployments.select { |d| d.metadata.annotations[ANNOTATION] }
deployments.select { |d| d.dig(:metadata, :annotations, ANNOTATION) }
end

def identify_target_statefulsets(selector: nil)
Expand All @@ -176,7 +176,7 @@ def identify_target_statefulsets(selector: nil)
selector_string = selector.to_s
apps_v1_kubeclient.get_stateful_sets(namespace: @namespace, label_selector: selector_string)
end
statefulsets.select { |d| d.metadata.annotations[ANNOTATION] }
statefulsets.select { |ss| ss.dig(:metadata, :annotations, ANNOTATION) }
end

def identify_target_daemonsets(selector: nil)
Expand All @@ -186,7 +186,7 @@ def identify_target_daemonsets(selector: nil)
selector_string = selector.to_s
apps_v1_kubeclient.get_daemon_sets(namespace: @namespace, label_selector: selector_string)
end
daemonsets.select { |d| d.metadata.annotations[ANNOTATION] }
daemonsets.select { |ds| ds.dig(:metadata, :annotations, ANNOTATION) }
end

def build_watchables(kubeclient_resources, started, klass)
Expand Down
2 changes: 1 addition & 1 deletion lib/krane/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Krane
VERSION = "2.3.0"
VERSION = "2.3.1"
end

0 comments on commit 7510c33

Please sign in to comment.