sensu-plugins-kubernetes 3.0.0 → 3.0.1

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
- SHA1:
3
- metadata.gz: fd22506c6a684c8f527e0d57ce2e5c8b5050f0af
4
- data.tar.gz: 50daf53d48ae07b3dbf4ad30e09d2ffe39ef8bf4
2
+ SHA256:
3
+ metadata.gz: c1b3b5137ced0c6f5389c7758feb32414c642e6892f097d72e504d50c3239e24
4
+ data.tar.gz: 18be79eb55bc1f39e24701dc515289c600e375e640bfa410efb01204307bd98b
5
5
  SHA512:
6
- metadata.gz: c2eebe712f8f1093c64dae0b0b39de8cf3fb611ad49360c6f64079f417a9a37aceeac43a8c212f2630cd6e56fbf8bfcb1d8790a669ef1830380663c87a1fbcf2
7
- data.tar.gz: ade09a14955da1adbce1ff6c3333e582a15140b0e39380b2b223c3ef6d27b95aee115b30da00dbdd71c8dad1d8e513b9bc971dfe1b912fb4a93e2965931f1c8f
6
+ metadata.gz: 14cda7064913e1b125fecc685c38f8632c4d40d9af234002ca5fffb63e5c1bbc28016d0fa3df2f3d37b08c5b4ebe964696b99e7c7d180fb6541d62e29ccea96c
7
+ data.tar.gz: c00a75f45747398767f47cc810c85d6f22832ba49c2c5cfe97542add001f0e10749ecc236e5feb73749b199e82a3bb357bfec0dd5d9022893ae96f6b2696b074
@@ -1,10 +1,13 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here ](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ### Fixed
9
+ - check-kube-pods-running.rb no longer throws an exception when there are no 3 conditions in the status information. Issue #39 (@AgarFu)
10
+
8
11
  ## [3.0.0] - 2017-09-12
9
12
  ### Breaking Change
10
13
  - check-kube-nodes-ready.rb no longer triggers an alert if an unschedulable node becomes NotReady (@tg90nor)
@@ -65,7 +68,8 @@ pending pods, the restart count portion has been split into it's own check, `che
65
68
  ### Added
66
69
  - initial release
67
70
 
68
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-kubernetes/compare/3.0.0...HEAD
71
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-kubernetes/compare/3.0.1...HEAD
72
+ [3.0.1]: https://github.com/sensu-plugins/sensu-plugins-kubernetes/compare/3.0.0...3.0.0.1
69
73
  [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-kubernetes/compare/2.0.0...3.0.0
70
74
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-kubernetes/compare/1.1.0...2.0.0
71
75
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-kubernetes/compare/1.0.0...1.1.0
@@ -91,9 +91,7 @@ class AllPodsAreRunning < Sensu::Plugins::Kubernetes::CLI
91
91
  next if should_exclude_namespace(pod.metadata.namespace)
92
92
  next unless pods_list.include?(pod.metadata.name) || pods_list.include?('all')
93
93
  next unless pod.status.phase != 'Succeeded' && !pod.status.conditions.nil?
94
- if pod.status.conditions[1].status == 'False' # This is the Ready state
95
- failed_pods << pod.metadata.name
96
- end
94
+ failed_pods << pod.metadata.name unless ready? pod
97
95
  end
98
96
 
99
97
  if failed_pods.empty?
@@ -115,4 +113,15 @@ class AllPodsAreRunning < Sensu::Plugins::Kubernetes::CLI
115
113
  return !config[:include_namespace].include?(namespace) unless config[:include_namespace].empty?
116
114
  config[:exclude_namespace].include?(namespace)
117
115
  end
116
+
117
+ def ready?(pod)
118
+ failed = true
119
+ pod.status.conditions.each do |c|
120
+ if c.type == 'Ready'
121
+ failed = false if c.status == 'True'
122
+ break
123
+ end
124
+ end
125
+ !failed
126
+ end
118
127
  end
@@ -76,8 +76,9 @@ module Sensu
76
76
  # Initializes the Sensu check by creating a Kubernetes client
77
77
  # from the given options and will report a critical error if
78
78
  # those arguments are incorrect.
79
- def initialize
79
+ def initialize(argv = ARGV)
80
80
  super()
81
+ self.argv = parse_options(argv)
81
82
  begin
82
83
  @client = kubeclient(
83
84
  server: config[:api_server],
@@ -2,7 +2,7 @@ module SensuPluginsKubernetes
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-kubernetes
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-17 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -235,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
235
  version: '0'
236
236
  requirements: []
237
237
  rubyforge_project:
238
- rubygems_version: 2.6.13
238
+ rubygems_version: 2.7.6
239
239
  signing_key:
240
240
  specification_version: 4
241
241
  summary: Sensu plugins for kubernetes