sensu-plugins-minio 0.0.4 → 0.0.7

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: 64bb081b5d04a0d0cb0bc43c8dc30eaec85d13fa4b604bae0c6575acb67123f0
4
- data.tar.gz: 226f4a97e66844d4986220a56c0c72c12a4d057f449b64619252950e09ab4bc7
3
+ metadata.gz: 5e9a263cc7dfaccc08b8b3e77912446cc57311b89847e321acba839bb6022438
4
+ data.tar.gz: 6580bfe8d6f051eb608aada8707a6bcf3241751cb3c001bf3f868d6f6a353974
5
5
  SHA512:
6
- metadata.gz: 70e729d70a4c5d2cccbef29135cb187c36956c60eefcd3753f2183cd70df9eb7d4afe083176933b99334dd8a4ec42366002661b98f2b9e0232034901946207d6
7
- data.tar.gz: dcca7b6c8937102069886772fa5a2e7cf42f86f024fa57c0241304391ddc633bcd94998effcf6e65f31de432c5c23bef67944a52a51633dd15380b65a0a6ac79
6
+ metadata.gz: 4f3d68b5e7e1038453e787ecbc3811c721cef660ed432f21853186aab00e2ea62bed66b423c2963cfb1d9318fbe08d611c2243131d0c9970d6838619c17f6b2b
7
+ data.tar.gz: ca7f4fcb79c96f4a411d6137e321bb339cd758a634ca95f822022be0a6c652bb297638f3fa594704bbf10ae54fd9b183ce569a38babe554bc1bf10d97643d5c9
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.4)
4
+ sensu-plugins-minio (0.0.7)
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.lines.first.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.4'
6
+ VERSION = '0.0.7'
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.4
4
+ version: 0.0.7
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-19 00:00:00.000000000 Z
12
+ date: 2022-06-07 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
  - - ">="