app/models/manageiq/providers/kubevirt/infra_manager/connection.rb
#
# Lazily creates the a client for the given Kubernetes API group and version.
#
# @param group [String] The Kubernetes API group.
# @param version [String] The Kubernetes API version.
# @return [Kubeclient::Client] The client for the given group and version.
#
Lazily creates the a client for the given Kubernetes API group and version.
Lazily creates the a client for the given Kubernetes API group and version .
def client(group, version)
    key = group + '/' + version
    client = @clients[key]
    return client if client
    path = if group == CORE_GROUP
             '/api'
           else
             '/apis/' + group
           end
    url = URI::Generic.build(
      :scheme => 'https',
      :host   => @host,
      :port   => @port,
      :path   => path
    )
    client = Kubeclient::Client.new(
      url.to_s,
      version,
      @opts
    )
    @clients[key] = client
    client
  end
def client ( group , version ) key = group + '/' + version client = @clients [ key ] return client if client path = if group == CORE_GROUP '/api' else '/apis/' + group end url = URI :: Generic . build ( :scheme => 'https' , :host => @host , :port => @port , :path => path ) client = Kubeclient :: Client . new ( url . to_s , version , @opts ) @clients [ key ] = client client end
Lazily creates the a client for the given Kubernetes API group and version.
Lazily creates the a client for the given Kubernetes API group and version .
# Return the client immediately if it has been created before: # Determine the API path: # Create the client and save it: # Return the client:
The client for the given group and version.
The client for the given group and version .
Kubeclient::Client
group
The Kubernetes API group.
The Kubernetes API group .
version
The Kubernetes API version.
The Kubernetes API version .