Monkey patches Kubeclient::Client#proxy_url in order to make it compliant with version 1.10 of kubernetes API
This commit is contained in:
parent
4d674bd38c
commit
0b1c690466
1 changed files with 15 additions and 0 deletions
15
config/initializers/kubeclient.rb
Normal file
15
config/initializers/kubeclient.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class Kubeclient::Client
|
||||
# We need to monkey patch this method until
|
||||
# https://github.com/abonas/kubeclient/pull/323 is merged
|
||||
def proxy_url(kind, name, port, namespace = '')
|
||||
discover unless @discovered
|
||||
entity_name_plural =
|
||||
if %w[services pods nodes].include?(kind.to_s)
|
||||
kind.to_s
|
||||
else
|
||||
@entities[kind.to_s].resource_name
|
||||
end
|
||||
ns_prefix = build_namespace_prefix(namespace)
|
||||
rest_client["#{ns_prefix}#{entity_name_plural}/#{name}:#{port}/proxy"].url
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue