-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding filtering features to task listing #170
Conversation
From @kellrott
|
@kellrott: Do you have an example call with filters that highlights the namespace issue (i.e., not being able to use, e.g., As for wanting to avoid |
From @kellrott and @aniewielska: It was suggested during recent Cloud WS meeting to check out how this is done in k8s. Reference: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#list-and-watch-filtering |
Another options would be to use annotations (https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/). I have seen several tools that integrate with others using annotations. For example the Let's Encrypt controller (https://github.com/tnozicka/openshift-acme) reads and writes annotations from the object it manage. I think the main advantage is that labels are often used ti link objects (Pods and services for example), and annotations are pure metadata. (Just my two cents) |
of key values, and will be zipped with an optional tag_value array. | ||
So the query: | ||
``` | ||
?tag_key=foo1&tag_value=bar1&tag_key=foo2&tag_value=bar2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the ordering of tag_key
and tag_value
params is not interleaved like in this example? I suppose the tag_key
and tag_value
arrays could be independently constructed and then zipped. But what if they aren't of equal length?
Also, is it possible to specify deliberately/explicitly an empty value, and if so, how? Would this be expected to work: ?tag_key=foo1&tag_value=&tag_key=food2&tag_value=bar2
? And if so, how about the same for keys, would an empty key be allowed?
Finally, there aren't any guidelines on escaping characters. What if a key or value name includes characters such as ?
or &
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag_key
and tag_value
arrays would be constructed first, and 'zipped' together. The shorter array would be filled in with blanks and behave in the way described on line 126.
You are correct, treating empty strings as 'wildcards' means that you can't search specifically for empty strings. I'm not really sure of an alternative, but I'm not sure if this is a blocker, as you could simple search for the existence of the tag and filter values manually on the client side.
I think character escaping would work via traditional HTML escaping. IE ?
would be ?
and &
would be &
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kellrott so for this example below what is the expected behavior?
{"foo": "", "baz": ""}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the input {"foo": "", "baz": ""}
we expect that both keys foo
and baz
exist. The values will be ignored and all instances of tasks with both foo
and baz
keys defined will be returned.
This could be coded as ?tag_key=foo&tag_key=baz
with no tag_value
set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with me too :)
Responding to #57 and porting changes from #104