Revision 5630b0c0
Added by Thomas McKay almost 6 years ago
app/models/katello/content_view_docker_filter.rb | ||
---|---|---|
|
||
query = manifest_klass.in_repositories(repo).where("id in (#{tags_query.to_sql})")
|
||
names = query.all.collect do |manifest|
|
||
manifest.docker_tags.where(:repository => repo).all.collect do |tag|
|
||
manifest.docker_tags.where(:repository => repo).where("name ilike ?", query_name).all.collect do |tag|
|
||
tag.uuid
|
||
end
|
||
end
|
test/models/content_view_docker_filter_test.rb | ||
---|---|---|
DockerMetaTag.import_meta_tags([repo2])
|
||
|
||
# search for goo in repo1
|
||
# should be a success
|
||
# should be a success and only goo
|
||
@rule.name = "goo"
|
||
@rule.save!
|
||
|
||
... | ... | |
clauses = filter.generate_clauses(repo1)
|
||
|
||
refute_empty clauses
|
||
assert_equal 2, clauses["_id"]["$in"].size
|
||
assert_includes clauses["_id"]["$in"], schema_goo_repo1.uuid
|
||
assert_includes clauses["_id"]["$in"], schema1_repo1.uuid
|
||
assert_equal 1, clauses["_id"]["$in"].size
|
||
assert_equal clauses["_id"]["$in"], [schema_goo_repo1.uuid]
|
||
|
||
# now search for goo in repo2
|
||
# it should be nil
|
Also available in: Unified diff
fixes #23747 - correct filter tags