sensu-plugins-minio 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 19ac09e90e84fceb0d61c7603997fe6de94944dc1a0694880adbbdb5d386e0df
4
- data.tar.gz: 1fd3fdd53520190c69bf82202bd4601c3bfea3f87608b54210bb5318fbe147b7
3
+ metadata.gz: f00a38420bc1ad65e8ccf268965ed75219a11eeafa60e80afbe50f22b5eae0bc
4
+ data.tar.gz: 0c669c47b834cb0fc51f3d64997937063a6fb335c00947835d3709ffd631ae3b
5
5
  SHA512:
6
- metadata.gz: bae5ce47c300d7a8d646cee087d88f1f56b4de7e6462045629a315bfe29547f6756a598d114550fd55df9461dcb5529dd294f676cae91dad19a5eb5b10f16941
7
- data.tar.gz: 1dec5b0cd15064f3f347170ebcf1a02af353c4f96d0df9f35d50a287a028bd7fc275d5399307a568f8aa3452d4509d2576bcdaecc78f217592bf4e654d718be0
6
+ metadata.gz: 41c0d7299cb06bb497470c2b910483a7b73d49882939fa81d6d5cb6c9f761f0311b3b416858dfb7ce407b1853926065c8e877dd0170175d0dabc5696604fc4eb
7
+ data.tar.gz: e8fcab007df8927aad63a95a9c20d54dae664c75269d1de54edccaef6a7288881134c09db39a5a1f44ef990b2023227a8d2974c2d3d4789ee5a49277ec916c4e
data/.rubocop.yml ADDED
@@ -0,0 +1,28 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.3
3
+
4
+ Lint/RaiseException:
5
+ Enabled: true
6
+
7
+ Lint/StructNewOverride:
8
+ Enabled: true
9
+
10
+
11
+ Metrics:
12
+ Enabled: false
13
+
14
+
15
+ Style/FrozenStringLiteralComment:
16
+ Enabled: false
17
+
18
+ Style/Documentation:
19
+ Enabled: false
20
+
21
+ Style/HashEachMethods:
22
+ Enabled: true
23
+
24
+ Style/HashTransformKeys:
25
+ Enabled: true
26
+
27
+ Style/HashTransformValues:
28
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sensu-plugins-minio (0.0.5)
4
+ sensu-plugins-minio (0.0.6)
5
5
  sensu-plugin (~> 2.1)
6
6
 
7
7
  GEM
@@ -12,62 +12,59 @@ GEM
12
12
  ast (2.4.2)
13
13
  crack (0.4.5)
14
14
  rexml
15
- diff-lcs (1.4.4)
15
+ diff-lcs (1.5.0)
16
16
  hashdiff (1.0.1)
17
- json (2.5.1)
17
+ jaro_winkler (1.5.4)
18
+ json (2.6.2)
18
19
  mixlib-cli (1.7.0)
19
- parallel (1.20.1)
20
- parser (3.0.2.0)
20
+ parallel (1.22.1)
21
+ parser (3.1.2.0)
21
22
  ast (~> 2.4.1)
22
- public_suffix (4.0.6)
23
- rainbow (3.0.0)
23
+ public_suffix (4.0.7)
24
+ rainbow (3.1.1)
24
25
  rake (13.0.6)
25
- regexp_parser (2.1.1)
26
26
  rexml (3.2.5)
27
- rspec (3.10.0)
28
- rspec-core (~> 3.10.0)
29
- rspec-expectations (~> 3.10.0)
30
- rspec-mocks (~> 3.10.0)
31
- rspec-core (3.10.1)
32
- rspec-support (~> 3.10.0)
33
- rspec-expectations (3.10.1)
27
+ rspec (3.11.0)
28
+ rspec-core (~> 3.11.0)
29
+ rspec-expectations (~> 3.11.0)
30
+ rspec-mocks (~> 3.11.0)
31
+ rspec-core (3.11.0)
32
+ rspec-support (~> 3.11.0)
33
+ rspec-expectations (3.11.0)
34
34
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.10.0)
36
- rspec-mocks (3.10.2)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-mocks (3.11.1)
37
37
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.10.0)
39
- rspec-support (3.10.2)
40
- rubocop (0.93.1)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-support (3.11.0)
40
+ rubocop (0.81.0)
41
+ jaro_winkler (~> 1.5.1)
41
42
  parallel (~> 1.10)
42
- parser (>= 2.7.1.5)
43
+ parser (>= 2.7.0.1)
43
44
  rainbow (>= 2.2.2, < 4.0)
44
- regexp_parser (>= 1.8)
45
45
  rexml
46
- rubocop-ast (>= 0.6.0)
47
46
  ruby-progressbar (~> 1.7)
48
47
  unicode-display_width (>= 1.4.0, < 2.0)
49
- rubocop-ast (1.8.0)
50
- parser (>= 3.0.1.1)
51
48
  ruby-progressbar (1.11.0)
52
49
  sensu-plugin (2.7.1)
53
50
  json (< 3.0.0)
54
51
  mixlib-cli (~> 1.5)
55
- unicode-display_width (1.7.0)
56
- webmock (3.13.0)
57
- addressable (>= 2.3.6)
52
+ unicode-display_width (1.8.0)
53
+ webmock (3.14.0)
54
+ addressable (>= 2.8.0)
58
55
  crack (>= 0.3.2)
59
56
  hashdiff (>= 0.4.0, < 2.0.0)
60
57
 
61
58
  PLATFORMS
62
- x86_64-linux
59
+ ruby
63
60
 
64
61
  DEPENDENCIES
65
- bundler (~> 2.2)
62
+ bundler (~> 2.1)
66
63
  rake (~> 13.0)
67
64
  rspec (~> 3.10)
68
- rubocop (~> 0.54)
65
+ rubocop (~> 0.54, <= 0.81)
69
66
  sensu-plugins-minio!
70
67
  webmock (~> 3.3)
71
68
 
72
69
  BUNDLED WITH
73
- 2.2.23
70
+ 2.1.4
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Sensu check for minio updates
2
2
 
3
+ Translates the presence of an outdated minio server instance into sensu check
4
+ results to reduce the time-to-patch for minio systems.
5
+
3
6
  ## Installation
4
7
 
5
8
  Add this line to your application's Gemfile:
@@ -24,7 +27,7 @@ Check if a the local minio version is in the most recent version
24
27
  Checks will check the default URL https://dl.min.io/server/minio/release
25
28
  and the default Platform linux-amd64 for updates. Adjust these optional
26
29
  parameters if you want to check a different platform or for whatever
27
- reason need to check a differen URL.
30
+ reason need to check a different URL.
28
31
 
29
32
  | Parameter | Description |
30
33
  | ------------------ | ----------------------------------------------- |
@@ -57,3 +60,7 @@ Plugin follows the [rubocop ruby style guide](https://github.com/rubocop-hq/ruby
57
60
 
58
61
  Bug reports and pull requests are welcome on GitHub at
59
62
  https://github.com/aboutsource/sensu-plugins-minio.
63
+
64
+ ## Security
65
+
66
+ * [Snyk](https://app.snyk.io/org/about-source/project/0a24cb05-4369-457c-8cca-7e4c395eb25e)
@@ -46,7 +46,6 @@ class CheckMinioUpdate < Sensu::Plugin::Check::CLI
46
46
  begin
47
47
  Timeout.timeout(timeout) do
48
48
  latest_version = get_latest_version(checkurl, platform)
49
- local_version = get_local_version
50
49
 
51
50
  if local_version == latest_version
52
51
  ok 'No new minio version available'
@@ -55,12 +54,14 @@ class CheckMinioUpdate < Sensu::Plugin::Check::CLI
55
54
  end
56
55
  end
57
56
  rescue IOError => e
58
- unknown "#{e.message}"
57
+ unknown e.message.to_s
59
58
  rescue Timeout::Error
60
59
  unknown 'Connection timed out'
61
60
  end
62
61
  end
63
62
 
63
+ private
64
+
64
65
  def get_latest_version(checkurl, platform)
65
66
  uri = URI.parse("#{checkurl}/#{platform}/minio.shasum")
66
67
  response = Net::HTTP.get_response(uri)
@@ -69,14 +70,18 @@ class CheckMinioUpdate < Sensu::Plugin::Check::CLI
69
70
  raise IOError, "Unable to gather latest minio version: #{response.body}"
70
71
  end
71
72
 
72
- return response.body.split.last.split('.', 2).last
73
+ response.body.split.last.split('.', 2).last
73
74
  end
74
75
 
75
- def get_local_version
76
- stdout, stderr, status = Open3.capture3({ 'PATH' => ENV['PATH'] }, 'minio --version', :unsetenv_others => true)
76
+ def local_version
77
+ stdout, stderr, status = Open3.capture3(
78
+ { 'PATH' => ENV['PATH'] }, 'minio --version', unsetenv_others: true
79
+ )
77
80
 
78
- raise IOError, "Unable to gather local minio version: #{stderr}" unless status.success?
81
+ unless status.success?
82
+ raise IOError, "Unable to gather local minio version: #{stderr}"
83
+ end
79
84
 
80
- return stdout.split.last
85
+ stdout.split.last
81
86
  end
82
87
  end
@@ -3,7 +3,7 @@
3
3
  module Sensu
4
4
  module Plugins
5
5
  module Minio
6
- VERSION = '0.0.5'
6
+ VERSION = '0.0.6'
7
7
  end
8
8
  end
9
9
  end
@@ -11,20 +11,23 @@ Gem::Specification.new do |spec|
11
11
  spec.authors = ['Hauke Altmann', 'Jonathan Schlue']
12
12
  spec.email = ['info@aboutsource.net']
13
13
 
14
- spec.summary = 'Check if there are updates for the local minio server instance'
14
+ spec.summary = 'Check if there are updates for the local '\
15
+ 'minio server instance'
15
16
  spec.description = 'Used to check for manual installed minio servers'
16
17
  spec.homepage = 'https://github.com/aboutsource/sensu-plugins-minio'
17
18
  spec.require_paths = ['lib']
18
19
 
19
- spec.executables = Dir.glob('bin/**/*.rb').map { |file| File.basename(file) }
20
+ spec.required_ruby_version = '>= 2.3.3'
21
+
22
+ spec.executables = Dir.glob('bin/**/*.rb').map { |f| File.basename(f) }
20
23
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
24
  f.match(%r{^(test|spec|features)/})
22
25
  end
23
26
 
24
27
  spec.add_dependency 'sensu-plugin', '~> 2.1'
25
- spec.add_development_dependency 'bundler', '~> 2.2'
28
+ spec.add_development_dependency 'bundler', '~> 2.1'
26
29
  spec.add_development_dependency 'rake', '~> 13.0'
27
30
  spec.add_development_dependency 'rspec', '~> 3.10'
28
- spec.add_development_dependency 'rubocop', '~> 0.54'
31
+ spec.add_development_dependency 'rubocop', '~> 0.54', '<= 0.81'
29
32
  spec.add_development_dependency 'webmock', '~> 3.3'
30
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-minio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hauke Altmann
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-07-20 00:00:00.000000000 Z
12
+ date: 2022-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sensu-plugin
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '2.2'
34
+ version: '2.1'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '2.2'
41
+ version: '2.1'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +74,9 @@ dependencies:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0.54'
77
+ - - "<="
78
+ - !ruby/object:Gem::Version
79
+ version: '0.81'
77
80
  type: :development
78
81
  prerelease: false
79
82
  version_requirements: !ruby/object:Gem::Requirement
@@ -81,6 +84,9 @@ dependencies:
81
84
  - - "~>"
82
85
  - !ruby/object:Gem::Version
83
86
  version: '0.54'
87
+ - - "<="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.81'
84
90
  - !ruby/object:Gem::Dependency
85
91
  name: webmock
86
92
  requirement: !ruby/object:Gem::Requirement
@@ -104,6 +110,7 @@ extensions: []
104
110
  extra_rdoc_files: []
105
111
  files:
106
112
  - ".gitignore"
113
+ - ".rubocop.yml"
107
114
  - ".ruby-version"
108
115
  - Gemfile
109
116
  - Gemfile.lock
@@ -127,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
127
134
  requirements:
128
135
  - - ">="
129
136
  - !ruby/object:Gem::Version
130
- version: '0'
137
+ version: 2.3.3
131
138
  required_rubygems_version: !ruby/object:Gem::Requirement
132
139
  requirements:
133
140
  - - ">="