sensu-plugins-minio 0.0.3 → 0.0.6

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: d74061e15df08517fa18fd66022c63eed26d23141f0cc60699e907f949bccd7f
4
- data.tar.gz: 161197e9bcc9ed4a0cccc89af3d3ca6b5c9996432e0429d80d6326c1ce9d15a6
3
+ metadata.gz: f00a38420bc1ad65e8ccf268965ed75219a11eeafa60e80afbe50f22b5eae0bc
4
+ data.tar.gz: 0c669c47b834cb0fc51f3d64997937063a6fb335c00947835d3709ffd631ae3b
5
5
  SHA512:
6
- metadata.gz: a1995cc2b3453c2d40bd22017dad9af13bc60dbc487cee5093a575fb5cb64a59302f864eedda2fa1d793c3029704cd80e1a98224ffe9e8ef0325052e9f9917e4
7
- data.tar.gz: c139954f08cb4fc7fe9c8fc84af54c4ea76c78435ce1c69965290695c17583fc40556d60cbb28810ceeef021a12e1c42562b95d95bc4edbece5aa0d6147e9558
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/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.0
data/Gemfile.lock CHANGED
@@ -1,56 +1,57 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sensu-plugins-minio (0.0.3)
4
+ sensu-plugins-minio (0.0.6)
5
5
  sensu-plugin (~> 2.1)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.7.0)
10
+ addressable (2.8.0)
11
11
  public_suffix (>= 2.0.2, < 5.0)
12
- ast (2.4.0)
13
- crack (0.4.3)
14
- safe_yaml (~> 1.0.0)
15
- diff-lcs (1.3)
16
- hashdiff (1.0.0)
17
- jaro_winkler (1.5.3)
18
- json (2.2.0)
12
+ ast (2.4.2)
13
+ crack (0.4.5)
14
+ rexml
15
+ diff-lcs (1.5.0)
16
+ hashdiff (1.0.1)
17
+ jaro_winkler (1.5.4)
18
+ json (2.6.2)
19
19
  mixlib-cli (1.7.0)
20
- parallel (1.17.0)
21
- parser (2.6.4.0)
22
- ast (~> 2.4.0)
23
- public_suffix (4.0.1)
24
- rainbow (3.0.0)
25
- rake (10.5.0)
26
- rspec (3.8.0)
27
- rspec-core (~> 3.8.0)
28
- rspec-expectations (~> 3.8.0)
29
- rspec-mocks (~> 3.8.0)
30
- rspec-core (3.8.2)
31
- rspec-support (~> 3.8.0)
32
- rspec-expectations (3.8.4)
20
+ parallel (1.22.1)
21
+ parser (3.1.2.0)
22
+ ast (~> 2.4.1)
23
+ public_suffix (4.0.7)
24
+ rainbow (3.1.1)
25
+ rake (13.0.6)
26
+ rexml (3.2.5)
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)
33
34
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.8.0)
35
- rspec-mocks (3.8.1)
35
+ rspec-support (~> 3.11.0)
36
+ rspec-mocks (3.11.1)
36
37
  diff-lcs (>= 1.2.0, < 2.0)
37
- rspec-support (~> 3.8.0)
38
- rspec-support (3.8.2)
39
- rubocop (0.74.0)
38
+ rspec-support (~> 3.11.0)
39
+ rspec-support (3.11.0)
40
+ rubocop (0.81.0)
40
41
  jaro_winkler (~> 1.5.1)
41
42
  parallel (~> 1.10)
42
- parser (>= 2.6)
43
+ parser (>= 2.7.0.1)
43
44
  rainbow (>= 2.2.2, < 4.0)
45
+ rexml
44
46
  ruby-progressbar (~> 1.7)
45
- unicode-display_width (>= 1.4.0, < 1.7)
46
- ruby-progressbar (1.10.1)
47
- safe_yaml (1.0.5)
47
+ unicode-display_width (>= 1.4.0, < 2.0)
48
+ ruby-progressbar (1.11.0)
48
49
  sensu-plugin (2.7.1)
49
50
  json (< 3.0.0)
50
51
  mixlib-cli (~> 1.5)
51
- unicode-display_width (1.6.0)
52
- webmock (3.7.2)
53
- addressable (>= 2.3.6)
52
+ unicode-display_width (1.8.0)
53
+ webmock (3.14.0)
54
+ addressable (>= 2.8.0)
54
55
  crack (>= 0.3.2)
55
56
  hashdiff (>= 0.4.0, < 2.0.0)
56
57
 
@@ -58,12 +59,12 @@ PLATFORMS
58
59
  ruby
59
60
 
60
61
  DEPENDENCIES
61
- bundler (~> 1.11)
62
- rake (~> 10.0)
63
- rspec (~> 3.7)
64
- rubocop (~> 0.54)
62
+ bundler (~> 2.1)
63
+ rake (~> 13.0)
64
+ rspec (~> 3.10)
65
+ rubocop (~> 0.54, <= 0.81)
65
66
  sensu-plugins-minio!
66
67
  webmock (~> 3.3)
67
68
 
68
69
  BUNDLED WITH
69
- 1.16.1
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('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.3'
6
+ VERSION = '0.0.6'
7
7
  end
8
8
  end
9
9
  end
@@ -8,23 +8,26 @@ Gem::Specification.new do |spec|
8
8
  spec.name = 'sensu-plugins-minio'
9
9
  spec.version = Sensu::Plugins::Minio::VERSION
10
10
  spec.licenses = ['MIT']
11
- spec.authors = ['Hauke Altmann']
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', '~> 1.11'
26
- spec.add_development_dependency 'rake', '~> 10.0'
27
- spec.add_development_dependency 'rspec', '~> 3.7'
28
- spec.add_development_dependency 'rubocop', '~> 0.54'
28
+ spec.add_development_dependency 'bundler', '~> 2.1'
29
+ spec.add_development_dependency 'rake', '~> 13.0'
30
+ spec.add_development_dependency 'rspec', '~> 3.10'
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,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-minio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hauke Altmann
8
+ - Jonathan Schlue
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-01-13 00:00:00.000000000 Z
12
+ date: 2022-05-31 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: sensu-plugin
@@ -30,42 +31,42 @@ dependencies:
30
31
  requirements:
31
32
  - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: '1.11'
34
+ version: '2.1'
34
35
  type: :development
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
39
  - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: '1.11'
41
+ version: '2.1'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: rake
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - "~>"
46
47
  - !ruby/object:Gem::Version
47
- version: '10.0'
48
+ version: '13.0'
48
49
  type: :development
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
53
  - - "~>"
53
54
  - !ruby/object:Gem::Version
54
- version: '10.0'
55
+ version: '13.0'
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: rspec
57
58
  requirement: !ruby/object:Gem::Requirement
58
59
  requirements:
59
60
  - - "~>"
60
61
  - !ruby/object:Gem::Version
61
- version: '3.7'
62
+ version: '3.10'
62
63
  type: :development
63
64
  prerelease: false
64
65
  version_requirements: !ruby/object:Gem::Requirement
65
66
  requirements:
66
67
  - - "~>"
67
68
  - !ruby/object:Gem::Version
68
- version: '3.7'
69
+ version: '3.10'
69
70
  - !ruby/object:Gem::Dependency
70
71
  name: rubocop
71
72
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +74,9 @@ dependencies:
73
74
  - - "~>"
74
75
  - !ruby/object:Gem::Version
75
76
  version: '0.54'
77
+ - - "<="
78
+ - !ruby/object:Gem::Version
79
+ version: '0.81'
76
80
  type: :development
77
81
  prerelease: false
78
82
  version_requirements: !ruby/object:Gem::Requirement
@@ -80,6 +84,9 @@ dependencies:
80
84
  - - "~>"
81
85
  - !ruby/object:Gem::Version
82
86
  version: '0.54'
87
+ - - "<="
88
+ - !ruby/object:Gem::Version
89
+ version: '0.81'
83
90
  - !ruby/object:Gem::Dependency
84
91
  name: webmock
85
92
  requirement: !ruby/object:Gem::Requirement
@@ -103,6 +110,8 @@ extensions: []
103
110
  extra_rdoc_files: []
104
111
  files:
105
112
  - ".gitignore"
113
+ - ".rubocop.yml"
114
+ - ".ruby-version"
106
115
  - Gemfile
107
116
  - Gemfile.lock
108
117
  - LICENSE
@@ -125,15 +134,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
134
  requirements:
126
135
  - - ">="
127
136
  - !ruby/object:Gem::Version
128
- version: '0'
137
+ version: 2.3.3
129
138
  required_rubygems_version: !ruby/object:Gem::Requirement
130
139
  requirements:
131
140
  - - ">="
132
141
  - !ruby/object:Gem::Version
133
142
  version: '0'
134
143
  requirements: []
135
- rubyforge_project:
136
- rubygems_version: 2.7.6
144
+ rubygems_version: 3.1.2
137
145
  signing_key:
138
146
  specification_version: 4
139
147
  summary: Check if there are updates for the local minio server instance