Skip to content

Commit 6e0d015

Browse files
authored
Merge pull request #583 from cben/drop-eol-ruby-2.5-2.6
Drop EOL ruby 2.5, 2.6 from CI on master branch.
2 parents fb54ef2 + f9f3710 commit 6e0d015

File tree

6 files changed

+23
-18
lines changed

6 files changed

+23
-18
lines changed

.github/workflows/actions.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ${{ matrix.os_and_command.os }}
1515
strategy:
1616
matrix:
17-
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', 'ruby-head', 'truffleruby-head' ]
17+
ruby: [ '2.7', '3.0', '3.1', 'ruby-head', 'truffleruby-head' ]
1818
os_and_command:
1919
- os: 'macos-latest'
2020
command: 'env TESTOPTS="--verbose" bundle exec rake test'
@@ -24,9 +24,10 @@ jobs:
2424
command: 'timeout --signal=TERM 3m env TESTOPTS="--verbose" test/config/update_certs_k0s.rb'
2525
include:
2626
# run rubocop against lowest supported ruby
27-
- os: ubuntu-latest
28-
ruby: '2.5'
29-
command: 'bundle exec rake rubocop'
27+
- ruby: '2.7'
28+
os_and_command:
29+
os: ubuntu-latest
30+
command: 'bundle exec rake rubocop'
3031
name: ${{ matrix.os_and_command.os }} ${{ matrix.ruby }} rake ${{ matrix.os_and_command.command }}
3132
steps:
3233
- uses: actions/checkout@v2

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: 2.5 # Oldest version kubeclient supports
2+
TargetRubyVersion: 2.7 # Oldest version kubeclient supports
33
NewCops: enable
44
Metrics/MethodLength:
55
Enabled: false

kubeclient.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
1818
spec.files = git_files.grep_v(%r{^(test|spec|features)/})
1919
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
2020
spec.test_files = []
21-
spec.required_ruby_version = '>= 2.5.0'
21+
spec.required_ruby_version = '>= 2.7.0'
2222

2323
spec.add_development_dependency 'bundler', '>= 1.6'
2424
spec.add_development_dependency 'rake', '~> 12.0'

lib/kubeclient.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def self.parse_definition(kind, name)
225225
# So don't expect full last word to match.
226226
/^(?<prefix>.*[A-Z])(?<singular_suffix>[^A-Z]*)$/ =~ kind # "NetworkP", "olicy"
227227
if name.start_with?(prefix.downcase)
228-
plural_suffix = name[prefix.length..-1] # "olicies"
228+
plural_suffix = name[prefix.length..] # "olicies"
229229
prefix_underscores = underscore_entity(prefix) # "network_p"
230230
method_names = [
231231
prefix_underscores + singular_suffix, # "network_policy"
@@ -482,7 +482,8 @@ def delete_entity(resource_name, name, namespace = nil, delete_options: {})
482482
# :orphan_dependents (bool) - should the dependent objects be orphaned
483483
# :propagation_policy (string) - one of Foreground|Background|Orphan
484484
# :resource_version (string) - sets a limit on the resource versions that can be served
485-
# :resource_version_match (string) - determines how the resource_version constraint will be applied
485+
# :resource_version_match (string) - determines how the resource_version constraint
486+
# will be applied
486487
# :timeout_seconds (integer) - limits the duraiton of the call
487488
# :continue (string) - a token used to retrieve the next chunk of entities
488489
# :as (:raw|:ros) - defaults to :ros
@@ -761,7 +762,7 @@ def http_options(uri)
761762
http_proxy_uri: @http_proxy_uri,
762763
http_max_redirects: http_max_redirects,
763764
bearer_token_file: @auth_options[:bearer_token_file],
764-
bearer_token: @auth_options[:bearer_token],
765+
bearer_token: @auth_options[:bearer_token]
765766
}
766767

767768
if uri.scheme == 'https'

lib/kubeclient/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# Kubernetes REST-API Client
44
module Kubeclient
5-
VERSION = '4.10.1'.freeze
5+
VERSION = '4.10.1'
66
end

test/test_watch.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ def test_watch_pod_api_bearer_token_file_success
113113
watcher = client.watch_pods(as: :raw)
114114

115115
begin
116-
file.write("valid_token")
116+
file.write('valid_token')
117117
file.rewind
118118
stub_token = stub_request(:get, %r{/watch/pods})
119-
.with(headers: { Authorization: 'Bearer valid_token' })
120-
.to_return(body: open_test_file('watch_stream.json'), status: 200)
119+
.with(headers: { Authorization: 'Bearer valid_token' })
120+
.to_return(body: open_test_file('watch_stream.json'), status: 200)
121121

122122
got = nil
123123
watcher.each { |notice| got = notice }
124124
assert_match(/\A{"type":"DELETED"/, got)
125125
remove_request_stub(stub_token)
126126

127-
file.write("rotated_token")
127+
file.write('rotated_token')
128128
file.close
129129
stub_request(:get, %r{/watch/pods})
130130
.with(headers: { Authorization: 'Bearer rotated_token' })
@@ -134,8 +134,8 @@ def test_watch_pod_api_bearer_token_file_success
134134
watcher.each { |notice| got = notice }
135135
assert_match(/\A{"type":"DELETED"/, got)
136136
ensure
137-
file.close
138-
file.unlink # deletes the temp file
137+
file.close
138+
file.unlink # deletes the temp file
139139
end
140140
end
141141

@@ -145,16 +145,19 @@ def test_watch_pod_api_bearer_token_success
145145
file = Tempfile.new('token')
146146
client = Kubeclient::Client.new(
147147
'http://localhost:8080/api/', 'v1',
148-
auth_options: { bearer_token: "valid_token" }
148+
auth_options: { bearer_token: 'valid_token' }
149149
)
150150

151-
stub_token = stub_request(:get, %r{/watch/pods})
151+
stub_request(:get, %r{/watch/pods})
152152
.with(headers: { Authorization: 'Bearer valid_token' })
153153
.to_return(body: open_test_file('watch_stream.json'), status: 200)
154154

155155
got = nil
156156
client.watch_pods(as: :raw).each { |notice| got = notice }
157157
assert_match(/\A{"type":"DELETED"/, got)
158+
ensure
159+
file.close
160+
file.unlink # deletes the temp file
158161
end
159162

160163
# Ensure that WatchStream respects a format that's not JSON

0 commit comments

Comments
 (0)