Skip to content

Commit

Permalink
kubernetes_connect: add timeout settings
Browse files Browse the repository at this point in the history
Needs newer kubeclient with ManageIQ/kubeclient#244
or backported ManageIQ/kubeclient#246
  • Loading branch information
cben committed May 1, 2017
1 parent 2940103 commit 4b2c7ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def kubernetes_connect(hostname, port, options)
options[:version] || kubernetes_version,
:ssl_options => Kubeclient::Client::DEFAULT_SSL_OPTIONS.merge(options[:ssl_options] || {}),
:auth_options => kubernetes_auth_options(options),
:http_proxy_uri => VMDB::Util.http_proxy_uri
:http_proxy_uri => VMDB::Util.http_proxy_uri,
:timeouts => {
:open => Settings.ems.ems_kubernetes.open_timeout.to_f_with_method,
:read => Settings.ems.ems_kubernetes.read_timeout.to_f_with_method
}
)
end

Expand Down
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
:ems_kubernetes:
:event_handling:
:event_groups:
:open_timeout: 60.seconds
:read_timeout: 60.seconds
:http_proxy:
:kubernetes:
:host:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
require 'kubeclient'
expect(Kubeclient::Client).to receive(:new).with(
instance_of(URI::HTTPS), 'v1',
hash_including(:http_proxy_uri => VMDB::Util.http_proxy_uri)
hash_including(:http_proxy_uri => VMDB::Util.http_proxy_uri,
:timeouts => match(:open => be > 0, :read => be > 0))
)
described_class.raw_connect(hostname, port, options)
end
Expand Down

0 comments on commit 4b2c7ea

Please sign in to comment.