Project tags is too restrictive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
Gage Hugo | ||
python-keystoneclient |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Currently, when querying project tags it only matches projects that have exactly the parameters given and no additional parameters. This is out of alignment with both the project tags spec and nova.
This is best explained by example:
Consider two projects: p1 and p2
p1 has tags [blue, green, red]
p2 has tag [blue]
tags=blue is only returning p1. It should return both p1 and p2.
tags=blue,green is returning no projects. This should return p1.
tags-any=blue is returning p1 and p2. This should continue to return both p1 and p2.
tags-any=
This also applies to not-tags and not-tags-any.
not-tags=blue is returning p1 and it should not.
not-tags=blue,green currently returning both p1 and p2. It should not return p1.
not-tags-any=blue should continue to not return both p1 and p2.
not-tags-
In other words, tags is currently returning projects that have an exact set of it's parameters. It should return projects that have a superset of it's parameters -- or all the parameters and maybe some other stuff.
tags should logically AND it's parameters
tags-any should logically OR it's parameters
This will bring us into alignment with the tags spec (although perhaps the tags spec could be updated to be clearer?) and also with Nova's server tags implementation.
Changed in keystone: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in keystone: | |
assignee: | nobody → Rajat Sharma (tajar29) |
Changed in keystone: | |
assignee: | Rajat Sharma (tajar29) → Gage Hugo (gagehugo) |
status: | Confirmed → In Progress |
Changed in keystone: | |
assignee: | Gage Hugo (gagehugo) → Nicolas Helgeson (nhelgeson) |
Changed in keystone: | |
assignee: | Nicolas Helgeson (nhelgeson) → Gage Hugo (gagehugo) |
Changed in keystone: | |
milestone: | none → rocky-1 |
This follows with the API-WG spec[0]'s example on combining tags, the example given is currently not possible with "exact" matching vs subset.
GET /servers? tags=red, blue&tags- any=green, orange
The above example returns any servers that have the “red” and “blue” tags, plus at least one of “green” and “orange”.
[0] https:/ /specs. openstack. org/openstack/ api-wg/ guidelines/ tags.html# filtering- and-searching- by-tags