Skip to content

Commit

Permalink
Merge pull request k8s-ruby#44 from diegotoral/ruby-3.2.2
Browse files Browse the repository at this point in the history
Add support for Ruby 3.2.2
  • Loading branch information
clintoncwolfe authored Aug 18, 2023
2 parents 5d6c485 + 0b6f8c5 commit c91c18a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ jobs:
- uses: actions/checkout@v3
- run: docker-compose build rspec-3.1
- run: docker-compose run rspec-3.1

build-3-2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker-compose build rspec-3.2
- run: docker-compose run rspec-3.2
7 changes: 7 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ services:
BASE_IMAGE: ruby:3.1
volumes:
- .:/app
rspec-3.2:
build:
context: .
args:
BASE_IMAGE: ruby:3.2
volumes:
- .:/app
entrypoint: bundle exec rspec
2 changes: 1 addition & 1 deletion k8s-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.bindir = "bin"
spec.executables = []
spec.require_paths = ["lib"]
spec.required_ruby_version = spec.required_ruby_version = [">= 2.4", "< 3.2"]
spec.required_ruby_version = spec.required_ruby_version = [">= 2.4", "<= 3.2.2"]

spec.add_runtime_dependency "excon", "~> 0.71"
spec.add_runtime_dependency "dry-struct", "<= 1.6.0"
Expand Down
16 changes: 10 additions & 6 deletions spec/k8s/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

subject { described_class }
context 'from KUBE_CA/KUBE_SERVER/KUBE_TOKEN variables' do

let(:server) { "localhost" }
let(:env) { { 'KUBE_TOKEN' => token, 'KUBE_CA' => ca, 'KUBE_SERVER' => server } }

Expand Down Expand Up @@ -125,11 +124,16 @@

context 'from default file locations' do
before do
stub_const("ENV", {}) # ensure ENV['KUBECONFIG'] is not used
expect(File).to receive(:exist?).with(default_kubeconfig_path).and_return(false)
expect(File).to receive(:exist?).with('/etc/kubernetes/admin.conf').and_return(false)
expect(File).to receive(:exist?).with('/etc/kubernetes/kubelet.conf').and_return(true)
expect(File).to receive(:readable?).with('/etc/kubernetes/kubelet.conf').and_return(true)
stub_const("ENV", { 'KUBECONFIG' => nil }) # ensure ENV['KUBECONFIG'] is not used

allow(File).to receive(:read).and_call_original
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:readable?).and_call_original

allow(File).to receive(:exist?).with(default_kubeconfig_path).and_return(false)
allow(File).to receive(:exist?).with('/etc/kubernetes/admin.conf').and_return(false)
allow(File).to receive(:exist?).with('/etc/kubernetes/kubelet.conf').and_return(true)
allow(File).to receive(:readable?).with('/etc/kubernetes/kubelet.conf').and_return(true)
end

it 'loads a file if found' do
Expand Down

0 comments on commit c91c18a

Please sign in to comment.