alexei-led / pumba

Chaos testing, network emulation, and stress testing tool for containers
Apache License 2.0
2.78k stars 195 forks source link

Multiple labels do not seem to work #171

Open diegohavenstein opened 4 years ago

diegohavenstein commented 4 years ago

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