Sha256: 205643ad7a0a279e9598ef888a8f11433de5d13e0655955221e243ac4b1249fc
Contents?: true
Size: 1.74 KB
Versions: 14
Compression:
Stored size: 1.74 KB
Contents
module Katello class DockerManifest < Katello::Model include Concerns::PulpDatabaseUnit has_many :docker_tags, :as => :docker_taggable, :class_name => "Katello::DockerTag", :dependent => :destroy has_many :repository_docker_manifests, :class_name => "Katello::RepositoryDockerManifest", :dependent => :destroy, :inverse_of => :docker_manifest has_many :repositories, :through => :repository_docker_manifests, :inverse_of => :docker_manifests has_many :docker_manifest_list_manifests, :class_name => "Katello::DockerManifestListManifest", :dependent => :delete_all, :inverse_of => :docker_manifest has_many :docker_manifest_lists, :through => :docker_manifest_list_manifests, :inverse_of => :docker_manifests CONTENT_TYPE = "docker_manifest".freeze scoped_search :relation => :docker_tags, :on => :name, :rename => :tag, :complete_value => true scoped_search :on => :digest, :rename => :digest, :complete_value => true, :only_explicit => true scoped_search :on => :schema_version, :rename => :schema_version, :complete_value => true, :only_explicit => true scoped_search :relation => :docker_manifest_lists, :on => :digest, :rename => :manifest_list_digest, :complete_value => true, :only_explicit => true def self.repository_association_class RepositoryDockerManifest end def self.default_sort order(:schema_version) end def manifest_type "image" end def remove_from_repository(repo_id) self.class.repository_association_class.where(:repository_id => repo_id, self.class.unit_id_field.to_sym => self.id).delete_all self.destroy if (self.repositories.empty? || self.docker_manifest_lists.empty?) DockerMetaTag.cleanup_tags end end end
Version data entries
14 entries across 14 versions & 1 rubygems