Skip to content

Commit

Permalink
Add default endpoint proxy specs
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Mar 6, 2024
1 parent 7835013 commit 603307f
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,30 @@
described_class.verify_credentials(params)
end
end

context "with no http_proxy set in Settings" do
before do
stub_settings_merge(:http_proxy => {:host => nil})
end

it "doesn't pass a proxy to Kubeclient" do
expect(Kubeclient::Client).to receive(:new).with(instance_of(URI::HTTPS), "v1", hash_including(:http_proxy_uri => nil)).and_return(kubeclient_client)

described_class.verify_credentials(params)
end
end

context "with http_proxy set in Settings" do
before do
stub_settings_merge(:http_proxy => {:host => "proxy.local"})
end

it "passes the proxy info to Kubeclient" do
expect(Kubeclient::Client).to receive(:new).with(instance_of(URI::HTTPS), "v1", hash_including(:http_proxy_uri => instance_of(URI::Generic))).and_return(kubeclient_client)

described_class.verify_credentials(params)
end
end
end

context "with invalid parameters" do
Expand Down

0 comments on commit 603307f

Please sign in to comment.