The README suggests that using multiple labels to match containers is supported:
--label value filter containers by labels, e.g '--label key=value' (multiple labels supported)
When I use a single label, it matches containers and targets them as expected. When I use multiple labels, e.g.
--label key1=value1,key2=value2
no containers are targeted, even though containers exist with labels key1=value1 and key2=value2
In my case, I use the auto-assigned io.kubernetes.container.name key to match the name of my container, and an additional one.
My question is: What is the expected semantics of passing multiple labels? Do all labels need to match (AND semantics) or just one (OR semantics)?
It should be clear in the README what the syntax for multiple labels is (it took me quite a while to figure this out! E.g. --label key1=value1 --label key2=value2 is syntactically wrong), and what its semantics are. It seems to me that none of these works though, as when I have a matching label and a non-matching one nothing gets targeted, which would suggest AND semantics. But if all labels have a match, it does not work, so also not AND semantics. If I use the labels individually (i.e. only key1=value1 or key2=value2) containers are targeted as expected
The README suggests that using multiple labels to match containers is supported:
--label value filter containers by labels, e.g '--label key=value' (multiple labels supported)
When I use a single label, it matches containers and targets them as expected. When I use multiple labels, e.g.
--label key1=value1,key2=value2
no containers are targeted, even though containers exist with labelskey1=value1
andkey2=value2
In my case, I use the auto-assigned
io.kubernetes.container.name
key to match the name of my container, and an additional one.My question is: What is the expected semantics of passing multiple labels? Do all labels need to match (AND semantics) or just one (OR semantics)?
It should be clear in the README what the syntax for multiple labels is (it took me quite a while to figure this out! E.g.
--label key1=value1 --label key2=value2
is syntactically wrong), and what its semantics are. It seems to me that none of these works though, as when I have a matching label and a non-matching one nothing gets targeted, which would suggest AND semantics. But if all labels have a match, it does not work, so also not AND semantics. If I use the labels individually (i.e. onlykey1=value1
orkey2=value2
) containers are targeted as expected