Skip to content

Commit

Permalink
Merge pull request
Browse files Browse the repository at this point in the history
ManageIQ/manageiq-providers-kubernetes#10 from cben/kubeclient-timeout

kubernetes_connect: add timeout settings
(cherry picked from merge commit ManageIQ/manageiq-providers-kubernetes@1ee90b5)

openshift_connect: use kubernetes timeout settings
(cherry picked from unmerged
ManageIQ/manageiq-providers-openshift#8 - unnecessary on master but required in backports)

Requires kubeclient >= 2.4.0
  • Loading branch information
cben committed May 15, 2017
1 parent ec7c981 commit d972272
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def openshift_connect(hostname, port, options)
options[:version] || api_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
end
Expand Down
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
:miq_namespace: management-infra
:image_inspector_registry: docker.io
:image_inspector_repository: openshift/image-inspector
:open_timeout: 60.seconds
:read_timeout: 60.seconds
:event_streams:
:history:
:keep_events: 6.months
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 d972272

Please sign in to comment.