Sha256: 6c4746ae271e328c0e2752f979f088cad15054da396145654e5ad697810cd258

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 Bytes

Contents

module Katello
  module Pulp3
    class DockerTag < PulpContentUnit
      include LazyAccessor

      def self.content_api
        PulpDockerClient::ContentTagsApi.new(Katello::Pulp3::Repository::Docker.api_client(SmartProxy.pulp_master!))
      end

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

      def update_model(model)
        custom_json = {}
        taggable = ::Katello::DockerManifest.find_by(:pulp_id => backend_data['tagged_manifest'])
        if taggable.nil?
          taggable = ::Katello::DockerManifestList.find_by(:pulp_id => backend_data['tagged_manifest'])
        end
        custom_json['docker_taggable'] = taggable
        custom_json['name'] = backend_data['name']
        model.update_attributes!(custom_json)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katello-3.14.1 app/services/katello/pulp3/docker_tag.rb
katello-3.14.0 app/services/katello/pulp3/docker_tag.rb
katello-3.14.0.rc2 app/services/katello/pulp3/docker_tag.rb
katello-3.14.0.rc1 app/services/katello/pulp3/docker_tag.rb