Sha256: 245573d9ddfdd180dad5a409bf3b86712a5e1356db78fdaeeac8771199a340d7

Contents?: true

Size: 1.14 KB

Versions: 22

Compression:

Stored size: 1.14 KB

Contents

module Katello
  module Util
    class DockerManifestClauseGenerator
      include Util::FilterClauseGenerator

      protected

      def fetch_filters
        ContentViewFilter.docker
      end

      def collect_clauses(repo, filters)
        [ContentViewDockerFilter].collect do |filter_class|
          content_type_filters = filters.where(:type => filter_class)
          make_manifest_clauses(repo, content_type_filters) unless content_type_filters.empty?
        end
      end

      def whitelist_non_matcher_clause
        {"name" => {"$not" => {"$exists" => true}}}
      end

      def whitelist_all_matcher_clause
        {"name" => {"$exists" => true}}
      end

      def make_manifest_clauses(repo, filters)
        pulp_content_clauses = filters.collect do |filter|
          filter.generate_clauses(repo)
        end
        pulp_content_clauses.flatten!
        pulp_content_clauses.compact!

        unless pulp_content_clauses.empty?
          manifest_clauses_from_content(pulp_content_clauses)
        end
      end

      def manifest_clauses_from_content(pulp_content_clauses)
        {"$or" => pulp_content_clauses}
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-3.5.2 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.5.1.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.5.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.5.0.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.5.0 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.5.0.rc2 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.5.0.rc1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.5 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.4 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.2 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.0.2 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.0.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.3.2 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.0 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.0.rc2 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.4.0.rc1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.3.1.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.3.1 app/lib/katello/util/docker_manifest_clause_generator.rb
katello-3.3.0.1 app/lib/katello/util/docker_manifest_clause_generator.rb