Sha256: 8b3afbb089a1429fdce4328fd733cce3cb4027aec6b5fafa7d93c8177293baf9

Contents?: true

Size: 754 Bytes

Versions: 5

Compression:

Stored size: 754 Bytes

Contents

module Katello
  module Concerns
    module ContainerExtensions
      extend ActiveSupport::Concern

      included do
        belongs_to :capsule, :inverse_of => :containers, :foreign_key => :capsule_id,
          :class_name => "SmartProxy"

        alias_method_chain :repository_pull_url, :katello
      end

      def repository_pull_url_with_katello
        repo_url = repository_pull_url_without_katello
        if Repository.where(:container_repository_name => repository_name).count > 0
          manifest_capsule = self.capsule || CapsuleContent.default_capsule.capsule
          "#{URI(manifest_capsule.url).hostname}:#{Setting['pulp_docker_registry_port']}/#{repo_url}"
        else
          repo_url
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
katello-3.5.2 app/models/katello/concerns/container_extensions.rb
katello-3.5.1.1 app/models/katello/concerns/container_extensions.rb
katello-3.5.1 app/models/katello/concerns/container_extensions.rb
katello-3.5.0.1 app/models/katello/concerns/container_extensions.rb
katello-3.5.0 app/models/katello/concerns/container_extensions.rb