Sha256: e86cf6e58b818ba6b8e41c5f72ad30c2b17ac581fdca553788812a77f3787b60

Contents?: true

Size: 1.2 KB

Versions: 43

Compression:

Stored size: 1.2 KB

Contents

module Katello
  module Pulp3
    class DockerTag < PulpContentUnit
      include LazyAccessor
      CONTENT_TYPE = "docker_tag".freeze

      def self.content_api
        PulpContainerClient::ContentTagsApi.new(Katello::Pulp3::Api::Docker.new(SmartProxy.pulp_primary!).api_client)
      end

      def self.ids_for_repository(repo_id)
        repo = Katello::Pulp3::Repository::Docker.new(Katello::Repository.find(repo_id), SmartProxy.pulp_primary)
        repo_content_list = repo.content_list
        repo_content_list.map { |content| content.try(:pulp_href) }
      end

      def self.generate_model_row(unit)
        row = {
          pulp_id: unit[unit_identifier],
          name: unit['name']
        }

        taggable = ::Katello::DockerManifest.find_by(:pulp_id => unit['tagged_manifest'])
        taggable_type = ::Katello::DockerManifest.name
        if taggable.nil?
          taggable = ::Katello::DockerManifestList.find_by(:pulp_id => unit['tagged_manifest'])
          taggable_type = ::Katello::DockerManifestList.name
        end

        if taggable
          row[:docker_taggable_id] = taggable.id
          row[:docker_taggable_type] = taggable_type
        end
        row
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
katello-4.10.0 app/services/katello/pulp3/docker_tag.rb
katello-4.9.2 app/services/katello/pulp3/docker_tag.rb
katello-4.10.0.rc2 app/services/katello/pulp3/docker_tag.rb
katello-4.10.0.rc1 app/services/katello/pulp3/docker_tag.rb
katello-4.8.4 app/services/katello/pulp3/docker_tag.rb
katello-4.9.1 app/services/katello/pulp3/docker_tag.rb
katello-4.8.3 app/services/katello/pulp3/docker_tag.rb
katello-4.9.0 app/services/katello/pulp3/docker_tag.rb
katello-4.7.6 app/services/katello/pulp3/docker_tag.rb
katello-4.8.2 app/services/katello/pulp3/docker_tag.rb
katello-4.9.0.rc2 app/services/katello/pulp3/docker_tag.rb
katello-4.9.0.rc1 app/services/katello/pulp3/docker_tag.rb
katello-4.8.1 app/services/katello/pulp3/docker_tag.rb
katello-4.7.5 app/services/katello/pulp3/docker_tag.rb
katello-4.8.0 app/services/katello/pulp3/docker_tag.rb
katello-4.8.0.rc2 app/services/katello/pulp3/docker_tag.rb
katello-4.7.4 app/services/katello/pulp3/docker_tag.rb
katello-4.8.0.rc1 app/services/katello/pulp3/docker_tag.rb
katello-4.7.3 app/services/katello/pulp3/docker_tag.rb
katello-4.7.2 app/services/katello/pulp3/docker_tag.rb