Sha256: b76c6de236502e636bdf35185c2a743739ba11359ddf3fcb28ab22664d7266dd

Contents?: true

Size: 703 Bytes

Versions: 4

Compression:

Stored size: 703 Bytes

Contents

class DefaultProxyProxySelector < ::RemoteExecutionProxySelector
  def initialize
    # TODO: Remove this once we have a reliable way of determining the internal proxy without katello
    # Tracked as https://projects.theforeman.org/issues/29840
    raise _('Internal proxy selector can only be used if Katello is enabled') unless defined?(::Katello)

    super
  end

  def available_proxies(host, provider)
    # TODO: Once we have a internal proxy marker/feature on the proxy, we can
    # swap the implementation
    internal_proxy = ::Katello.default_capsule
    super.reduce({}) do |acc, (key, proxies)|
      acc.merge(key => proxies.select { |proxy| proxy == internal_proxy })
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_remote_execution-3.3.3 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-3.3.2 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-3.3.1 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-3.3.0 app/services/default_proxy_proxy_selector.rb